Skip to content

Commit

Permalink
tests
Browse files Browse the repository at this point in the history
  • Loading branch information
camillebrianceau committed Oct 3, 2024
1 parent 765f29a commit e34a034
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions clinicadl/trainer/config/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
from clinicadl.network.config import NetworkConfig
from clinicadl.optimizer.optimization import OptimizationConfig
from clinicadl.optimizer.optimizer import OptimizerConfig
from clinicadl.splitter.config import SplitConfig
from clinicadl.splitter.validation import ValidationConfig
from clinicadl.trainer.transfer_learning import TransferLearningConfig
from clinicadl.transforms.config import TransformsConfig
Expand Down Expand Up @@ -48,6 +49,7 @@ class TrainConfig(BaseModel, ABC):
optimization: OptimizationConfig
optimizer: OptimizerConfig
reproducibility: ReproducibilityConfig
split: SplitConfig
ssda: SSDAConfig
transfer_learning: TransferLearningConfig
transforms: TransformsConfig
Expand Down
4 changes: 2 additions & 2 deletions tests/unittests/train/trainer/test_training_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,14 +181,14 @@ def test_fails_validations(bad_inputs, training_config):
def test_passes_validations(good_inputs, training_config):
c = training_config(**good_inputs)
assert not c.computational.gpu
assert c.validation.n_splits == 7
assert c.split.n_splits == 7
assert c.optimizer.optimizer == "Adagrad"
assert c.transforms.data_augmentation == ("Smoothing",)
assert c.data.diagnoses == ("AD",)
assert c.dataloader.batch_size == 1
assert c.transforms.size_reduction_factor == 5
assert c.optimizer.learning_rate == 1e-1
assert c.validation.split == (0,)
assert c.split.split == (0,)
assert c.early_stopping.tolerance == 0.0


Expand Down

0 comments on commit e34a034

Please sign in to comment.