-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/main' into splits_prediction_refac
- Loading branch information
Showing
87 changed files
with
3,323 additions
and
2,923 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,3 +8,4 @@ updates: | |
time: "08:00" | ||
ignore: | ||
- dependency-name: "numpy" | ||
- dependency-name: "zarr" |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,41 +1,63 @@ | ||
"""Configuration module.""" | ||
"""CAREamics Pydantic configuration models. | ||
To maintain clarity at the module level, we follow the following naming conventions: | ||
`*_model` is specific for sub-configurations (e.g. architecture, data, algorithm), | ||
while `*_configuration` is reserved for the main configuration models, including the | ||
`Configuration` base class and its algorithm-specific child classes. | ||
""" | ||
|
||
__all__ = [ | ||
"CAREAlgorithm", | ||
"CAREConfiguration", | ||
"CheckpointModel", | ||
"Configuration", | ||
"CustomModel", | ||
"DataConfig", | ||
"FCNAlgorithmConfig", | ||
"GaussianMixtureNMConfig", | ||
"GeneralDataConfig", | ||
"InferenceConfig", | ||
"LVAELossConfig", | ||
"MultiChannelNMConfig", | ||
"N2NAlgorithm", | ||
"N2NConfiguration", | ||
"N2VAlgorithm", | ||
"N2VConfiguration", | ||
"N2VDataConfig", | ||
"TrainingConfig", | ||
"VAEAlgorithmConfig", | ||
"clear_custom_models", | ||
"UNetBasedAlgorithm", | ||
"VAEBasedAlgorithm", | ||
"algorithm_factory", | ||
"configuration_factory", | ||
"create_care_configuration", | ||
"create_n2n_configuration", | ||
"create_n2v_configuration", | ||
"data_factory", | ||
"load_configuration", | ||
"register_model", | ||
"save_configuration", | ||
] | ||
from .architectures import CustomModel, clear_custom_models, register_model | ||
|
||
from .algorithms import ( | ||
CAREAlgorithm, | ||
N2NAlgorithm, | ||
N2VAlgorithm, | ||
UNetBasedAlgorithm, | ||
VAEBasedAlgorithm, | ||
) | ||
from .callback_model import CheckpointModel | ||
from .configuration_factory import ( | ||
from .care_configuration import CAREConfiguration | ||
from .configuration import Configuration | ||
from .configuration_factories import ( | ||
algorithm_factory, | ||
configuration_factory, | ||
create_care_configuration, | ||
create_n2n_configuration, | ||
create_n2v_configuration, | ||
data_factory, | ||
) | ||
from .configuration_model import ( | ||
Configuration, | ||
load_configuration, | ||
save_configuration, | ||
) | ||
from .data_model import DataConfig | ||
from .fcn_algorithm_model import FCNAlgorithmConfig | ||
from .configuration_io import load_configuration, save_configuration | ||
from .data import DataConfig, GeneralDataConfig, N2VDataConfig | ||
from .inference_model import InferenceConfig | ||
from .loss_model import LVAELossConfig | ||
from .n2n_configuration import N2NConfiguration | ||
from .n2v_configuration import N2VConfiguration | ||
from .nm_model import GaussianMixtureNMConfig, MultiChannelNMConfig | ||
from .training_model import TrainingConfig | ||
from .vae_algorithm_model import VAEAlgorithmConfig |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
"""Algorithm configurations.""" | ||
|
||
__all__ = [ | ||
"CAREAlgorithm", | ||
"N2NAlgorithm", | ||
"N2VAlgorithm", | ||
"UNetBasedAlgorithm", | ||
"VAEBasedAlgorithm", | ||
] | ||
|
||
from .care_algorithm_model import CAREAlgorithm | ||
from .n2n_algorithm_model import N2NAlgorithm | ||
from .n2v_algorithm_model import N2VAlgorithm | ||
from .unet_algorithm_model import UNetBasedAlgorithm | ||
from .vae_algorithm_model import VAEBasedAlgorithm |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
"""CARE algorithm configuration.""" | ||
|
||
from typing import Annotated, Literal | ||
|
||
from pydantic import AfterValidator | ||
|
||
from careamics.config.architectures import UNetModel | ||
from careamics.config.validators import ( | ||
model_without_final_activation, | ||
model_without_n2v2, | ||
) | ||
|
||
from .unet_algorithm_model import UNetBasedAlgorithm | ||
|
||
|
||
class CAREAlgorithm(UNetBasedAlgorithm): | ||
"""CARE algorithm configuration. | ||
Attributes | ||
---------- | ||
algorithm : "care" | ||
CARE Algorithm name. | ||
loss : {"mae", "mse"} | ||
CARE-compatible loss function. | ||
""" | ||
|
||
algorithm: Literal["care"] = "care" | ||
"""CARE Algorithm name.""" | ||
|
||
loss: Literal["mae", "mse"] = "mae" | ||
"""CARE-compatible loss function.""" | ||
|
||
model: Annotated[ | ||
UNetModel, | ||
AfterValidator(model_without_n2v2), | ||
AfterValidator(model_without_final_activation), | ||
] | ||
"""UNet without a final activation function and without the `n2v2` modifications.""" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
"""N2N Algorithm configuration.""" | ||
|
||
from typing import Annotated, Literal | ||
|
||
from pydantic import AfterValidator | ||
|
||
from careamics.config.architectures import UNetModel | ||
from careamics.config.validators import ( | ||
model_without_final_activation, | ||
model_without_n2v2, | ||
) | ||
|
||
from .unet_algorithm_model import UNetBasedAlgorithm | ||
|
||
|
||
class N2NAlgorithm(UNetBasedAlgorithm): | ||
"""Noise2Noise Algorithm configuration.""" | ||
|
||
algorithm: Literal["n2n"] = "n2n" | ||
"""N2N Algorithm name.""" | ||
|
||
loss: Literal["mae", "mse"] = "mae" | ||
"""N2N-compatible loss function.""" | ||
|
||
model: Annotated[ | ||
UNetModel, | ||
AfterValidator(model_without_n2v2), | ||
AfterValidator(model_without_final_activation), | ||
] | ||
"""UNet without a final activation function and without the `n2v2` modifications.""" |
Oops, something went wrong.