Skip to content

Refactor algorithms module #1

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

Merged
merged 4 commits into from
May 23, 2025
Merged

Refactor algorithms module #1

merged 4 commits into from
May 23, 2025

Conversation

Obi-Wan
Copy link
Contributor

@Obi-Wan Obi-Wan commented May 21, 2025

Description

The algorithms module currently suffers from a list of different problems:

  1. It is quite large, making browsing/changes a bit too tedious and error prone
  2. The N2N and DIP algorithms have lower reproducibility, because the training/cross-validation pixel mask is randomly re-initialized at each call of the training function
  3. Also for N2N and DIP, the current infer method expects input data to be already structured in a way that can be almost directly fed into the model. However, there is not function to prepare the data for more complex data structures/organizations
  4. The API is a bit all over the place, differing widely from method to method

This PR proposes a set of changes that address those points by:

  • Splitting the algorithms module into a sub-package, addressing point 1
  • Adding a data preparation function for the N2N and DIP algorithms, which addresses points 2 and 3
  • Making the training API more homogeneous, addressing point 4

TODO

  • Implement changes:
    • Split the algorithms in different files
    • Homogenize training API
    • Adding data preparation function for N2N and DIP
  • Add/update unit tests
  • Add/update documentation:
    • Examples
    • Docstrings
    • Tutorials

Notes

This is a prerequisite for future enhancements like:

  • 2.5D data treatment for N2N
  • 1D and 3D data treatment for all algorithms
  • Support of data transforms to DIP, which would enable tackling problems like deconvolution, super-resolution, and other inverse problems like tomography, phase retrieval, etc.

@Obi-Wan Obi-Wan self-assigned this May 21, 2025
@Obi-Wan Obi-Wan added the enhancement New feature or request label May 21, 2025
…thms in dedicated modules.

The API has also changed, which will require a major release bump

Signed-off-by: Nicola VIGANÒ <[email protected]>
@Obi-Wan Obi-Wan force-pushed the algorithms-refactor branch from d7c46ce to 6a6c8f5 Compare May 22, 2025 23:45
@Obi-Wan Obi-Wan marked this pull request as ready for review May 23, 2025 12:46
@Obi-Wan Obi-Wan merged commit 1ff5afa into main May 23, 2025
4 checks passed
@Obi-Wan Obi-Wan deleted the algorithms-refactor branch May 23, 2025 12:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant