LFTAdaptedModel<T, TInput, TOutput>
Models & Types · AiDotNet.MetaLearning.Models
The state LFT adapted to one task: the encoder as the inner loop left it, and the metric head that scores each example against the task’s classes.
Inheritance: ModelWrapperBase<T, TInput, TOutput> → MetaLearningModelBase<T, TInput, TOutput> → LFTAdaptedModel<T, TInput, TOutput>
Implements: IGeneratedParameterRegistrar<T>
For Beginners
after adapting to a task, this model turns each example into features and then asks the head “how much does this look like each class?”, giving one probability per class.
How It Works
LFT (Tseng et al. 2020) classifies with a metric head over the encoder’s features. Adaptation used to return the bare encoder, so predicting gave one feature vector per example where the task asks for one score per class - the trained head, which is the only part of the model that knows how many classes there are, was discarded at the moment it was needed.
The feature-wise transformation is deliberately absent here: the paper removes those layers before the model is used, so applying them at inference would inject the very noise they exist to simulate during training.
Constructors
| Constructor | Summary |
|---|---|
LFTAdaptedModel(IFullModel<T, TInput, TOutput> encoder, Vector<T> metricHead, int featureDimension, int outputDimension) |
Initializes the adapted model. |
Properties
| Property | Summary |
|---|---|
Vector<T> MetricHead { get; } |
Gets the metric head this model scores with. |
Methods
| Method | Summary |
|---|---|
IFullModel<T, TInput, TOutput> WithParameters(Vector<T> parameters) |
|
TOutput Predict(TInput input) |