TrainingHistory#
- class pyqit.core.TrainingHistory[source]#
Bases:
objectMetrics recorded once per epoch, backend-agnostic.
- train_loss, val_loss, train_acc, val_acc
One entry per completed epoch.
val_*are NaN without a validation split.- Type:
list of float
- epoch_times#
Wall-clock seconds per epoch.
- Type:
list of float
- best_epoch#
Epoch with the best score.
- Type:
int
- best_score#
That epoch’s value of
best_metric.- Type:
float
- best_metric#
Which metric the best epoch was chosen on:
val_losswhen a validation split exists,train_lossotherwise. NaN loses every comparison, so monitoringval_lossunconditionally left a run without a validation split reportinginf @ epoch 0.- Type:
{“val_loss”, “train_loss”}
- record(epoch: int, train_loss: float, val_loss: float = nan, train_acc: float = 0.0, val_acc: float = 0.0, epoch_time: float = 0.0) None[source]#
Append one epoch’s metrics and update the running best.
- Parameters:
epoch (int) – Zero-based epoch index.
train_loss (float) – Mean training loss over the epoch.
val_loss (float, default NaN) – Validation loss; NaN means the run has no validation split.
train_acc (float, default 0.0) – Accuracies for the epoch.
val_acc (float, default 0.0) – Accuracies for the epoch.
epoch_time (float, default 0.0) – Wall-clock seconds the epoch took.