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 one

Parameters:
Returns:

a dictionary with all updated values

Return type:

dict

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:

dict

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:

dict