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

Make images.ImageCube passthrough default, remove nn.Parameter from ImageCube #246

Closed
iancze opened this issue Dec 27, 2023 · 0 comments · Fixed by #243
Closed

Make images.ImageCube passthrough default, remove nn.Parameter from ImageCube #246

iancze opened this issue Dec 27, 2023 · 0 comments · Fixed by #243
Assignees

Comments

@iancze
Copy link
Collaborator

iancze commented Dec 27, 2023

Throughout the codebase and tutorials, we always use images.ImageCube with passthrough=True. In this mode, ImageCube's forward method acts like an identity function with some cached state self.cube stored in a 'packed' format ready for easy passing to the FFT. After the first call to forward, (regardless of whether passthrough=True) there are convenience methods for reading the cube in 'sky format', calculating the total flux, and exporting the image to FITS.

I don't think we ever use ImageCube in a non-passthrough capacity. This is a holdover feature from before we introduced BaseCube. The only justification for keeping this functionality would be where the user wanted a direct mapping from self.cube pixels to true sky pixels. I would argue that this is
a) usually not desireable... enforcing non-negative pixel fluxes is a physically motivated and often strong regularization
b) better accomplished by using BaseCube with a pixel_mapping function of lambda x : x.

Suggested changes
Make ImageCube a passthrough layer by default and remove capacity for nn.Parameter in this layer entirely.

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 a pull request may close this issue.

1 participant