MidEpochCheckpointer
Models & Types · AiDotNet.Data.Pipeline
Saves and restores training state mid-epoch for fault tolerance.
How It Works
Enables resuming training from the exact batch within an epoch after a failure. Saves the current batch index, epoch number, and any custom state as a binary checkpoint. Automatically rotates old checkpoints to limit disk usage.
Constructors
| Constructor | Summary |
|---|---|
MidEpochCheckpointer(MidEpochCheckpointerOptions options) |
Creates a new mid-epoch checkpointer. |
Methods
| Method | Summary |
|---|---|
CheckpointData LoadCheckpoint(string filePath) |
Loads a specific checkpoint file. |
CheckpointData LoadLatestCheckpoint() |
Loads the latest checkpoint from the checkpoint directory. |
bool OnBatchComplete(int epoch, int batchIndex, byte[] customState) |
Called after each batch to potentially save a checkpoint. |
void SaveCheckpoint(int epoch, int batchIndex, byte[] customState) |
Saves a checkpoint with the current training state. |