Table of Contents

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

T

The 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

teacherType TeacherModelType

The type of teacher to create.

model IFullModel<T, Vector<T>, Vector<T>>

Optional: IFullModel to wrap as a teacher (required for NeuralNetwork type).

ensembleModels ITeacherModel<Vector<T>, Vector<T>>[]

Optional: Array of models for ensemble (required for Ensemble type).

ensembleWeights double[]

Optional: Weights for ensemble models.

outputDimension int?

Optional: Output dimension (inferred from model if not provided).

onlineUpdateMode OnlineUpdateMode

Optional: Update mode for Online teacher (default: EMA).

onlineUpdateRate double

Optional: Update rate for Online teacher (default: 0.999).

curriculumStrategy CurriculumStrategy

Optional: Strategy for Curriculum teacher (default: EasyToHard).

quantizationBits int

Optional: Bits for Quantized teacher (default: 8, recommended for most cases).

aggregationMode AggregationMode

Optional: 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.