Trainer Reference

Trainer

class dacapo.experiments.trainers.Trainer
abstract build_batch_provider(datasets, model, task, snapshot_container)

Initialize the training pipeline using the datasets, model, task and snapshot_container

The training datasets are required s.t. the pipeline knows where to pull data from. The model is needed to inform the pipeline of required input/output sizes The task is needed to transform gt into target The snapshot_container defines where snapshots will be saved.

Return type:

None

abstract can_train(datasets)

Can this trainer train with a specific set of datasets. Some trainers may have requirements for their training datasets.

Return type:

bool

abstract create_optimizer(model)

Create a torch optimizer for the given model.

Return type:

Optimizer

abstract iterate(num_iterations, model, optimizer, device)

Perform num_iterations training iterations.

Return type:

Iterator[TrainingIterationStats]

class dacapo.experiments.trainers.GunpowderTrainer(trainer_config)
build_batch_provider(datasets, model, task, snapshot_container=None)

Initialize the training pipeline using the datasets, model, task and snapshot_container

The training datasets are required s.t. the pipeline knows where to pull data from. The model is needed to inform the pipeline of required input/output sizes The task is needed to transform gt into target The snapshot_container defines where snapshots will be saved.

can_train(datasets)

Can this trainer train with a specific set of datasets. Some trainers may have requirements for their training datasets.

Return type:

bool

create_optimizer(model)

Create a torch optimizer for the given model.

iterate(num_iterations, model, optimizer, device)

Perform num_iterations training iterations.