Table of Contents

Class DistillationCheckpointConfig

Namespace
AiDotNet.KnowledgeDistillation
Assembly
AiDotNet.dll

Configuration for distillation checkpoint management.

public class DistillationCheckpointConfig
Inheritance
DistillationCheckpointConfig
Inherited Members

Remarks

For Beginners: This class controls when and how models are saved during knowledge distillation training. Think of it like the "auto-save" settings in a video game.

Properties

BestMetric

Metric to use for determining "best" checkpoint (e.g., "validation_loss", "accuracy").

public string BestMetric { get; set; }

Property Value

string

CheckpointDirectory

Directory where checkpoints will be saved.

public string CheckpointDirectory { get; set; }

Property Value

string

CheckpointPrefix

Prefix for checkpoint filenames.

public string CheckpointPrefix { get; set; }

Property Value

string

KeepBestN

Keep only the best N checkpoints based on validation metric.

public int KeepBestN { get; set; }

Property Value

int

Remarks

Set to 0 to keep all checkpoints. Example: KeepBestN = 3 keeps only the 3 checkpoints with best validation performance.

LowerIsBetter

Whether lower metric values are better (true for loss, false for accuracy).

public bool LowerIsBetter { get; set; }

Property Value

bool

SaveCurriculumState

Save curriculum strategy state with checkpoint.

public bool SaveCurriculumState { get; set; }

Property Value

bool

Remarks

Allows resuming with correct curriculum progress.

SaveEveryBatches

Save checkpoint every N batches (0 = disabled).

public int SaveEveryBatches { get; set; }

Property Value

int

Remarks

Useful for very long epochs. Example: SaveEveryBatches = 1000 means save after 1000 batches, 2000 batches, etc.

SaveEveryEpochs

Save checkpoint every N epochs (0 = disabled).

public int SaveEveryEpochs { get; set; }

Property Value

int

Remarks

Example: SaveEveryEpochs = 5 means save after epochs 5, 10, 15, etc.

SaveMetadata

Save training metadata (epoch number, loss history, etc.).

public bool SaveMetadata { get; set; }

Property Value

bool

SaveStudent

Save the student model checkpoint.

public bool SaveStudent { get; set; }

Property Value

bool

SaveTeacher

Save the teacher model checkpoint.

public bool SaveTeacher { get; set; }

Property Value

bool

Remarks

Useful for multi-stage distillation where student becomes teacher.