Skip to content

Hyperparameters Callback

Source

Callback saving CAREamics configuration as hyperparameters in the model.

HyperParametersCallback

Bases: Callback

Callback allowing saving CAREamics configuration as hyperparameters in the model.

This allows saving the configuration as dictionary in the checkpoints, and loading it subsequently in a CAREamist instance.

Parameters:

  • config (Configuration) –

    CAREamics configuration to be saved as hyperparameter in the model.

Attributes:

  • config (Configuration) –

    CAREamics configuration to be saved as hyperparameter in the model.

__init__(config)

Constructor.

Parameters:

  • config (Configuration) –

    CAREamics configuration to be saved as hyperparameter in the model.

on_train_start(trainer, pl_module)

Update the hyperparameters of the model with the configuration on train start.

Parameters:

  • trainer (Trainer) –

    PyTorch Lightning trainer, unused.

  • pl_module (LightningModule) –

    PyTorch Lightning module.