xnn.common.config.schema.TrainerConfig#
- class xnn.common.config.schema.TrainerConfig(loggers=<factory>, log_every_n_epochs=1, log_every_n_steps=0, step_average='batch', metrics=<factory>, monitor='val/loss', mode='min', val_every_n_epochs=1, save_every_n_epochs=0, early_stopping_patience=0, early_stopping_min_delta=0.0, early_stopping_threshold=None, progress_bar=False)[source]#
Bases:
objectLogging, error metrics, checkpointing and stopping of a training run.
- Variables:
loggers (list of str) – Where the metrics go: any of
console,csv(metrics.csvinoutput_dir) andtensorboard(output_dir/tensorboard). Defaults to["console"].log_every_n_epochs (int) – Log the epoch metrics every n epochs (and after the last). Defaults to
1.log_every_n_steps (int) – When
> 0, also log the training values every n optimizer steps. Defaults to0.step_average (str) – What a step value is:
"batch"(that step’s batch) or"running"(the epoch so far). Defaults to"batch".metrics (list of str) – Error metrics computed besides the loss terms, from
maeandrmse, for every labelled property (energy per atom, forces, stress, dipole, polarizability, charges). Defaults to both.monitor (str) – The logged value that picks
best.pt, drives the plateau scheduler and early stopping, e.g.val/forces_mae. Aval/monitor falls back totrain/without a validation set. Defaults to"val/loss".mode (str) –
"min"or"max": whether a lower or a higher monitored value is better. Defaults to"min".val_every_n_epochs (int) – Validate every n epochs (and after the last). Defaults to
1.save_every_n_epochs (int) – When
> 0, also keepepoch_<n>.ptevery n epochs. Defaults to0.early_stopping_patience (int) – Stop after this many validations without improvement of the monitored value;
0(default) never stops early.early_stopping_min_delta (float) – The least change that counts as an improvement. Defaults to
0.0.early_stopping_threshold (float, optional) – Stop as soon as the monitored value is better than this. Defaults to
None.progress_bar (bool) – Show a progress bar over each epoch’s batches. Defaults to
False.
- Parameters: