cobrawap icon indicating copy to clipboard operation
cobrawap copied to clipboard

Vectorization of convolution functions in utils/convolve.py

Open FMarmoreo opened this issue 1 year ago • 2 comments

The implementation of the phase_conv2d, nan_conv2d and norm_angle has been replaced by a vectorized implementation approach to significantly speed up code execution (~200x faster for nan_conv2d and ~40x faster for phase_conv2d).

WARNING: This implementation also fixes the boundary conditions issue taken into account by PR #66. Please consider to merge PR #66 before this one for result consistency.

FMarmoreo avatar Jun 21 '24 15:06 FMarmoreo

@FMarmoreo could you test whether the output of the updated functions are all equivalent to the previous versions and post the results? Otherwise, a change in behavior would need to be documented.

rgutzen avatar Jun 25 '24 09:06 rgutzen

Here a test about the new implementation of phase_conv2d, compared to the old implementation (after having fixed the bug as in PR #66): original The difference between them stays below the double precision of the machine: diff

cosimolupo avatar Jun 27 '24 14:06 cosimolupo