CurriculumDistillationStrategyBase<T>
Base Classes ยท AiDotNet.KnowledgeDistillation.Strategies
Abstract base class for curriculum distillation strategies with progressive difficulty adjustment.
Inheritance: DistillationStrategyBase<T> โ CurriculumDistillationStrategyBase<T>
Implements: ICurriculumDistillationStrategy<T>
Known derived types: EasyToHardCurriculumStrategy<T>, HardToEasyCurriculumStrategy<T>
For Beginners
This base class provides common functionality for curriculum learning, including progress tracking, sample difficulty management, and temperature progression.
How It Works
For Implementers: Derive from this class and implement
ComputeCurriculumTemperature and ShouldIncludeSample to define
your specific curriculum progression logic.
Shared Features:
- Curriculum progress tracking (0.0 to 1.0)
- Sample difficulty scoring and management
- Temperature range validation
- Step/epoch-based progression
Properties
| Property | Summary |
|---|---|
double CurriculumProgress { get; } |
Gets the current curriculum progress (0.0 to 1.0). |
double MaxTemperature { get; } |
Gets the maximum temperature for the curriculum. |
double MinTemperature { get; } |
Gets the minimum temperature for the curriculum. |
int TotalSteps { get; } |
Gets the total number of steps in the curriculum. |
Methods
| Method | Summary |
|---|---|
Matrix<T> ComputeGradient(Matrix<T> studentBatchOutput, Matrix<T> teacherBatchOutput, Matrix<T> trueLabelsBatch) |
Computes gradient with curriculum-adjusted temperature. |
T ComputeLoss(Matrix<T> studentBatchOutput, Matrix<T> teacherBatchOutput, Matrix<T> trueLabelsBatch) |
Computes distillation loss with curriculum-adjusted temperature. |
bool ShouldIncludeSample(int sampleIndex) |
Determines if a sample should be included in current curriculum stage. |
double ComputeCurriculumTemperature() |
Computes the curriculum-adjusted temperature based on current progress. |
double? GetSampleDifficulty(int sampleIndex) |
Gets the difficulty score for a sample, if set. |
void SetSampleDifficulty(int sampleIndex, double difficulty) |
Sets the difficulty score for a specific sample. |
void UpdateProgress(int step) |
Updates the current curriculum progress. |