oa::CbCheckpoint
oa::CbCheckpoint keras modelCheckpoint(save_freq="epoch") + EarlyStopping's restore_best_weights, on top of oa::CheckpointManager. Every epoch end writes a resumable rotating checkpoint. Pass SaveEvery > 0 to add mid-epoch checkpoints every N completed optimizer steps. The master model is updated only on improvement. at each epoch end it prints a TF-style mini summary: epoch 3: cross_entropy improved from 0.4056 to 0.3486 — saving model epoch 4: cross_entropy did not improve from 0.3486 at train end, if RestoreBest is set and the best epoch wasn't the last one, the best checkpoint is loaded back into model + optimizer — you always walk away with the best weights, not whatever the final (possibly degraded) epoch produced. Monitored value: inMetric->result() when provided (e.g. a val_loss metric), otherwise the epoch mean train loss. Better/worse direction comes from the manager's lowerIsBetter config.
Inheritance
public CbTraining · public Callback
Public Methods
Constructor & Destructor Documentation
Parameters
inMgroa::CheckpointManager &—
inModeloa::Module &—
inOptoa::Optimizer &—
inSaveEveryoa::I64Default: 0
inMetricoa::Metric *Default: nullptr
inRestoreBestboolDefault: true
inVerboseboolDefault: true
Public Method Documentation
Returns
oa::I64The declared return value.
Returns
oa::StatusThe declared return value.
Parameters
inIteroa::ItTraining &—
Returns
voidThe declared return value.
Parameters
inIteroa::ItTraining &—
Returns
voidThe declared return value.
Parameters
inIteroa::ItTraining &—
Returns
voidThe declared return value.