TADAMModel<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Models

TADAM model for few-shot classification with task conditioning and metric scaling.

Implements: IModel<TInput, TOutput, ModelMetadata<T>>

For Beginners

After TADAM sees the support examples and computes task-conditioned prototypes, this model stores those prototypes along with the learned metric scaling parameters. It can then classify new examples by measuring scaled distances to these prototypes.

How It Works

This model stores the adapted state of TADAM after computing task-conditioned prototypes. It uses learned metric scaling and temperature to classify new query examples.

Constructors

Constructor Summary
TADAMModel(IFullModel<T, TInput, TOutput> featureEncoder, Dictionary<int, Tensor<T>> prototypes, Vector<T> metricScale, T temperature, TADAMOptions<T, TInput, TOutput> options) Initializes a new instance of the TADAMModel.

Properties

Property Summary
ModelMetadata<T> Metadata { get; }

Methods

Method Summary
ModelMetadata<T> GetModelMetadata()
TOutput Predict(TInput input)
Vector<T> GetParameters()
void Train(TInput inputs, TOutput targets)
void UpdateParameters(Vector<T> parameters)