Skip to content

Improve parameter tuning#25

Merged
Obi-Wan merged 18 commits into
mainfrom
improve_parameter_tuning
Dec 24, 2025
Merged

Improve parameter tuning#25
Obi-Wan merged 18 commits into
mainfrom
improve_parameter_tuning

Conversation

@Obi-Wan

@Obi-Wan Obi-Wan commented Dec 13, 2025

Copy link
Copy Markdown
Collaborator

Description

Hyperparameter tuning is fundamental for obtaining good reconstructions when using regularizations. corrct currently offers support for single hyperparameter tuning, based on the L-curve and cross-validation methods. However, with growing needs for other work distribution tools than the basic ThreadPoolExecutor, the current API and infrastructure are inadequate to support further developments. This PR cleans the API, while making it more flexible and transparent. It also refactors internal code to use a more structured and scalable approach (using simpler functions and fewer nested class methods). Finally, this PR also introduces simple support for K-fold cross-validation and tracking performance metrics of the reconstructions.

TODO

  • Implement new feature:
    • Refactor naming: spawn -> init, and call -> exec (while keeping the old deprecated interface)
    • Generalize parallel and serial processing code
    • Add support for passing keyword arguments to both init and exec functions
    • Add support for specifying the mask argument name in the cross-validation processing
    • Add support for tracking performance metrics of the individual task and the batches
    • Add support for k-fold cross-validation
    • Optional: add support for no init function
    • Optional: add support for variadic return arguments for the init function
  • Add or update unittests.
  • Add or update docstrings.
  • Add or update documentation.

Notes

Performance metrics and all reconstructions are currently only returned when requested with the return_all argument set to True. This should reduce memory usage when those features are not necessary.

…panded API.

Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
@Obi-Wan Obi-Wan added this to the Release v2 milestone Dec 13, 2025
@Obi-Wan Obi-Wan self-assigned this Dec 13, 2025
@Obi-Wan Obi-Wan added the enhancement New feature or request label Dec 13, 2025
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
…nting

Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
…ction

Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
@Obi-Wan

Obi-Wan commented Dec 18, 2025

Copy link
Copy Markdown
Collaborator Author

We should probably use this PR to also add decent documentation for this feature.

Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola VIGANÒ <nicola.vigano@cea.fr>
Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
…putation

Signed-off-by: Nicola Vigano <nicola.vigano@cea.fr>
@Obi-Wan Obi-Wan merged commit abf3a8b into main Dec 24, 2025
8 checks passed
@Obi-Wan Obi-Wan deleted the improve_parameter_tuning branch January 13, 2026 10:20
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