Class TeacherModelFactory<T>
- Namespace
- AiDotNet.KnowledgeDistillation
- Assembly
- AiDotNet.dll
Factory for creating teacher models from enums and configurations.
public static class TeacherModelFactory<T>
Type Parameters
TThe numeric type for calculations.
- Inheritance
-
TeacherModelFactory<T>
- Inherited Members
Methods
CreateTeacher(TeacherModelType, IFullModel<T, Vector<T>, Vector<T>>?, ITeacherModel<Vector<T>, Vector<T>>[]?, double[]?, int?, OnlineUpdateMode, double, CurriculumStrategy, int, AggregationMode)
Creates a teacher model from the specified type and configuration.
public static ITeacherModel<Vector<T>, Vector<T>> CreateTeacher(TeacherModelType teacherType, IFullModel<T, Vector<T>, Vector<T>>? model = null, ITeacherModel<Vector<T>, Vector<T>>[]? ensembleModels = null, double[]? ensembleWeights = null, int? outputDimension = null, OnlineUpdateMode onlineUpdateMode = OnlineUpdateMode.EMA, double onlineUpdateRate = 0.999, CurriculumStrategy curriculumStrategy = CurriculumStrategy.EasyToHard, int quantizationBits = 8, AggregationMode aggregationMode = AggregationMode.Average)
Parameters
teacherTypeTeacherModelTypeThe type of teacher to create.
modelIFullModel<T, Vector<T>, Vector<T>>Optional: IFullModel to wrap as a teacher (required for NeuralNetwork type).
ensembleModelsITeacherModel<Vector<T>, Vector<T>>[]Optional: Array of models for ensemble (required for Ensemble type).
ensembleWeightsdouble[]Optional: Weights for ensemble models.
outputDimensionint?Optional: Output dimension (inferred from model if not provided).
onlineUpdateModeOnlineUpdateModeOptional: Update mode for Online teacher (default: EMA).
onlineUpdateRatedoubleOptional: Update rate for Online teacher (default: 0.999).
curriculumStrategyCurriculumStrategyOptional: Strategy for Curriculum teacher (default: EasyToHard).
quantizationBitsintOptional: Bits for Quantized teacher (default: 8, recommended for most cases).
aggregationModeAggregationModeOptional: Aggregation mode for Distributed teacher (default: Average).
Returns
- ITeacherModel<Vector<T>, Vector<T>>
A configured teacher model.
Remarks
For Beginners: All optional parameters have industry-standard recommended defaults. You typically only need to specify teacherType and model.