CAVIAModel<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

CAVIA inference model that uses adapted context parameters for predictions.

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

For Beginners

After adapting CAVIA to a new task, you get this model. It automatically adds the learned task context to your inputs, so you can use it just like any other model: call Predict() with new examples.

How It Works

This model wraps the meta-learned body parameters with task-specific context parameters. It is returned by Adapt and provides fast inference by augmenting inputs with the adapted context before passing to the model.

Constructors

Constructor Summary
CAVIAModel(IFullModel<T, TInput, TOutput> bodyModel, Vector<T> adaptedContext, CAVIAOptions<T, TInput, TOutput> options) Initializes a new instance of the CAVIAModel with adapted context.

Properties

Property Summary
ModelMetadata<T> Metadata { get; } Gets the model metadata.
Vector<T> AdaptedContext { get; } Gets the adapted context vector for inspection or further processing.

Methods

Method Summary
ModelMetadata<T> GetModelMetadata() Gets metadata about this CAVIA inference model.
TOutput Predict(TInput input) Makes predictions by augmenting input with the adapted context and running through the body model.
Vector<T> GetParameters() Gets model parameters (not applicable for CAVIA inference models).
void Train(TInput inputs, TOutput targets) Trains the model (not applicable for CAVIA inference models).
void UpdateParameters(Vector<T> parameters) Updates model parameters (not applicable for CAVIA inference models).