PretrainedTeacherModel<T>

Models & Types · AiDotNet.KnowledgeDistillation.Teachers

Pretrained teacher model from external source (e.g., ImageNet, BERT).

Inheritance: TeacherModelBase<Vector<T>, Vector<T>, T> → PretrainedTeacherModel<T>

How It Works

This wrapper takes a Func<Vector<T>, Vector<T>> forward-pass delegate and invokes it directly on every GetLogits call. The wrapper itself performs no caching or graph compilation — any optimizations (including Tensors’ AutoTracer auto-compile) depend entirely on what happens inside the supplied delegate. A delegate that wraps a standard neural-network model’s Predict path will pick up those engine-level optimizations; a delegate that invokes external code (pre-converted ONNX, a REST call, etc.) will not.

Constructors

Constructor Summary
PretrainedTeacherModel(Func<Vector<T>, Vector<T>> pretrainedForward, int inputDimension, int outputDimension) Initializes a new instance using a function delegate (not JIT-compilable).

Properties

Property Summary
int OutputDimension { get; }

Methods

Method Summary
Vector<T> GetLogits(Vector<T> input) Gets logits from the pretrained model.