Skip to content

Config

Config dataclass #

The options required for a run. This dataclass acts as a structure for the Hydra configs.

For more info, see https://hydra.cc/docs/tutorials/structured_config/schema/

algorithm instance-attribute #

algorithm: Any

Configuration for the algorithm (a LightningModule).

It is suggested for this class to accept a datamodule and network as arguments. The instantiated datamodule and network will be passed to the algorithm's constructor.

For more info, see the instantiate_algorithm function.

datamodule class-attribute instance-attribute #

datamodule: Optional[Any] = None

Configuration for the datamodule (dataset + transforms + dataloader creation).

This should normally create a LightningDataModule. See the MNISTDataModule for an example.

trainer class-attribute instance-attribute #

trainer: dict = field(default_factory=dict)

Keyword arguments for the Trainer constructor.

log_level class-attribute instance-attribute #

log_level: str = 'info'

Logging level.

seed class-attribute instance-attribute #

seed: int = field(
    default_factory=lambda: randint(0, int(100000.0))
)

Random seed for reproducibility.

If None, a random seed is generated.

ckpt_path class-attribute instance-attribute #

ckpt_path: str | None = None

Path to a checkpoint to load the training state and resume the training run.

This is the same as the ckpt_path argument in the lightning.Trainer.fit method.