Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Torch FFT Rotation & Juillard23 IPCA #651

Merged
merged 2 commits into from
Nov 6, 2024

Conversation

Sand-jrd
Copy link
Contributor

@Sand-jrd Sand-jrd commented Nov 6, 2024

1-Adding Torch for Faster FFT Rotation Mode
Fft rotation using vip-fft mode use Numpy library. The use of Torch instead of Numpy consistently improves speed. New imlib='torch-fft'.Having Torch remains an optional dependency, and a check to determine whether or not Torch is installed has been implemented.

Here are the differences between the Torch FFT and VIP FFT methods for 50 rotations of a cube. The time is measured in seconds. The third image shows the difference between both rotation methods. The use of Torch instead of Numpy consistently improves speed.
torch fft 2 780

FYI (NOT IN THIS COMMIT)- Torch with Built-in Rotation Method (Bilinear/Nearest) not faster than Open CV
Here are the differences between the Torch and OpenCV methods for 50 rotations of a cube, with time measured in seconds. The third image shows the difference between the two rotation methods. In this case, the use of OpenCV is better, hence, I did not included the option of using Torch Built-in Rotation Method in the commit.
Pytorch 0 269

2-Adding “Juillard23” Mode to IPCA
The “Juillard23” mode has been added to the IPCA mode, enabling users to utilize the implementation from Juillard et al. (2023/2024). This method has no additional options for significant signal extraction and works exclusively with Torch, making it faster but also more prone to propagating noise and disk flux. The mode can return a stim map and residual map if full-output is set to true. This option is only compatible with 'ADI' and 'ARDI'; an error is raised if the options do not match. Other parameters, such as imbil and interpolation, are ignored. This option only uses nit, ncomp, pup_mask_center_px, cube_ref, cube, and angle_list. In particular, the threshold is always set to 0, and STIM is only computed at the end and is not part of the iterative process. Installation of the GreeDS package (via pip install GreeDS) is required for this option. GreeDS is now a new optional dependency of VIP.
vip_fft 15 219753 Greeds Sand 0 496539

1-Adding Torch for Faster FFT Rotation Mode
Fft rotation using vip-fft mode use numpy library. The use of Torch instead of Numpy consistently improves speed. New imlib='torch-fft'.

2-Adding “Juillard23” Mode to IPCA
The “Juillard23” mode has been added to the IPCA mode, enabling users to utilize the implementation from Juillard et al. (2023/2024). This method has no additional options for significant signal extraction and works exclusively with Torch, making it faster but also more prone to propagating noise and disk flux. The mode can return a stim map and residual map if full-output is set to true. This option is only compatible with 'ADI' and 'ARDI'; an error is raised if the options do not match. Other parameters, such as imbil and interpolation, are ignored. This option only uses nit, ncomp, pup_mask_center_px, cube_ref, cube, and angle_list. Installation of the GreeDS package (via pip install GreeDS) is required for this option. In particular, the threshold is always set to 0, and STIM is only computed at the end and is not part of the iterative process.
@Sand-jrd Sand-jrd closed this Nov 6, 2024
@Sand-jrd
Copy link
Contributor Author

Sand-jrd commented Nov 6, 2024

I need to remove the type definitions to fix the check failures.

@Sand-jrd Sand-jrd reopened this Nov 6, 2024
@VChristiaens VChristiaens merged commit 820bbb8 into vortex-exoplanet:master Nov 6, 2024
28 checks passed
@VChristiaens
Copy link
Contributor

Great! Thanks a lot @Sand-jrd !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants