utilities¶
AddDanStagesCallback¶
-
class
AddDanStagesCallback
(epoch_freq)[source]¶ Bases:
sphinx.ext.autodoc.importer._MockObject
Callback to frequently activate new stages (if available)
Parameters: epoch_freq (int) – number of epochs to wait, before activating the next stage -
at_epoch_end
(trainer, epoch, **kwargs)[source]¶ Function which activates the next stage if the current epoch is
epoch_freq
epochs after activating the last oneParameters: - trainer (
delira.training.PyTorchNetworkTrainer
) – the trainer holding the model - epoch (int) – the current epoch
Returns: a dictionary with all updated values
Return type: - trainer (
-
create_optimizers_dan_whole_network¶
-
create_optimizers_dan_whole_network
(model: dan.model.DeepAlignmentNetwork, optim_cls, max_stages, **optim_params)[source]¶ Creates one optimizer containing all stages’ parameters
Parameters: - model (DeepAlignmentNetwork) – the model, whose parameters should be optimized
- optim_cls – the actual optimizer class
- max_stages (int) – the number of maximum stages to optimize
Returns: dictionary containing the optimizer optimizers
Return type:
create_optimizers_dan_per_stage¶
-
create_optimizers_dan_per_stage
(model: dan.model.DeepAlignmentNetwork, optim_cls, max_stages, **optim_params)[source]¶ Creates optimizers for differnt DAN stages
Parameters: - model (DeepAlignmentNetwork) – the model, whose parameters should be optimized
- optim_cls – the actual optimizer class
- max_stages (int) – the number of maximum stages to optimize
Returns: dictionary containing all optimizers
Return type: