Feature: Next-Gen CAREamist API#717
Merged
Merged
Conversation
CatEek
reviewed
Feb 3, 2026
CatEek
reviewed
Feb 3, 2026
CatEek
reviewed
Feb 3, 2026
CatEek
reviewed
Feb 3, 2026
CatEek
reviewed
Feb 3, 2026
| ) | ||
|
|
||
| @staticmethod | ||
| def _from_config( |
Contributor
There was a problem hiding this comment.
We should prob discuss using 3 separate methods, CAREamist.from_config, from_checkpoint etc
Member
|
Just pointing out also that there is an |
Member
Author
Looks like this might be due to rebase artefact after inheritance of UNetModule was removed from lightning module, I will have a look at that |
Member
Author
|
There is a new error with the tests, I will have a look tomorrow morning |
jdeschamps
approved these changes
Feb 4, 2026
melisande-c
added a commit
that referenced
this pull request
Feb 4, 2026
## Description > [!NOTE] > **tldr**: Skeleton of new version of the CAREamist API that uses the Next-Gen Dataset and refactored Lightning Modules. Only initialising from a config/config file or a checkpoint has been implemented. ### Background - why do we need this PR? With everything that has changed with the recent refactoring it is easier to rewrite the CAREamics API rather than try and integrate the changes. ### Overview - what changed? - If loading from a checkpoint or bmz, the `training_config` and `experiment_name` can be overridden. - The plan is to pass the checkpoint path to the trainer which will load the optimiser and LR schedular state dicts, this means however that if someone wants to resume training, they will likely have to increase the max epochs. - If finetuning one might want to override the experiment name. - `HyperParametersCallback` replaced by calls to `save_hyperparameters` in the lightning modules and data_modules plus a new `CareamicsCheckpointInfo` callback. - Lighning module save the algorithm config, data module saves the data config, and `CareamicsCheckpointInfo` saves the training_config, the experiment_name and the version. - Should be more convenient for Lightning API users (they don't need to remember `HyperParametersCallback`. - checkpoints saved without `CareamicsCheckpointInfo` can still be loaded by the CAREamist API if a `training_config` and `experiment_name` are provided at initialisation. ### Implementation - how did you implement the changes? Copied most of the function signatures from original CAREamist API. Decided to use overloads for different initialisation paths, we could also discuss `@classmethod` constructors. ## Changes Made ### New features or files - CAREamistV2 - `CareamicsCheckpointInfo` - helper functions for lightning module creation in `src/careamics/lightning/dataset_ng/lightning_modules/get_module.py` ## How has this been tested? No tests yet ## Related Issues - Resolves #649 --- **Please ensure your PR meets the following requirements:** - [ ] Code builds and passes tests locally, including doctests - [ ] New tests have been added (for bug fixes/features) - [ ] Pre-commit passes - [ ] PR to the documentation exists (for bug fixes / features) --------- Co-authored-by: veegalinova <[email protected]> Co-authored-by: Vera Galinova <[email protected]> Co-authored-by: Joran Deschamps <[email protected]>
This was referenced Feb 26, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Note
tldr: Skeleton of new version of the CAREamist API that uses the Next-Gen Dataset and refactored Lightning Modules. Only initialising from a config/config file or a checkpoint has been implemented.
Background - why do we need this PR?
With everything that has changed with the recent refactoring it is easier to rewrite the CAREamics API rather than try and integrate the changes.
Overview - what changed?
training_configandexperiment_namecan be overridden.HyperParametersCallbackreplaced by calls tosave_hyperparametersin the lightning modules and data_modules plus a newCareamicsCheckpointInfocallback.CareamicsCheckpointInfosaves the training_config, the experiment_name and the version.HyperParametersCallback.CareamicsCheckpointInfocan still be loaded by the CAREamist API if atraining_configandexperiment_nameare provided at initialisation.Implementation - how did you implement the changes?
Copied most of the function signatures from original CAREamist API.
Decided to use overloads for different initialisation paths, we could also discuss
@classmethodconstructors.Changes Made
New features or files
CareamicsCheckpointInfosrc/careamics/lightning/dataset_ng/lightning_modules/get_module.pyHow has this been tested?
No tests yet
Related Issues
CAREamist-like module as high-level API #649Please ensure your PR meets the following requirements: