dacapo.experiments.trainers.trainer_config

Classes

TrainerConfig

A class to represent the Trainer Configurations.

Module Contents

class dacapo.experiments.trainers.trainer_config.TrainerConfig

A class to represent the Trainer Configurations.

It is the base class for trainer configurations. Each subclass of a Trainer should have a specific config class derived from TrainerConfig.

name

A unique name for this trainer.

Type:

str

batch_size

The batch size to be used during training.

Type:

int

learning_rate

The learning rate of the optimizer.

Type:

float

verify() Tuple[bool, str]

Verify whether this TrainerConfig is valid or not.

Note

The TrainerConfig class is an abstract class that cannot be instantiated directly. It is meant to be subclassed.

name: str
batch_size: int
learning_rate: float
verify() Tuple[bool, str]

Verify whether this TrainerConfig is valid or not. A TrainerConfig is considered valid if it has a valid batch size and learning rate.

Returns:

A tuple containing a boolean indicating whether the TrainerConfig is valid and a message explaining why.

Return type:

tuple

Raises:

NotImplementedError – If the method is not implemented by the subclass.

Examples

>>> valid, message = trainer_config.verify()
>>> valid
True
>>> message
"No validation for this Trainer"

Note

This method must be implemented by the subclass.