IMetaLearningAlgorithm<T, TInput, TOutput>

Interfaces · AiDotNet.MetaLearning.Algorithms

Represents a meta-learning algorithm that can learn from multiple tasks.

For Beginners

Meta-learning is “learning to learn” - the algorithm practices adapting to new tasks quickly by training on many different tasks.

Think of it like learning to learn languages:

  • Instead of just learning one language, you learn many languages
  • Over time, you get better at picking up new languages quickly
  • When you encounter a new language, you can learn it faster than the first time

Similarly, a meta-learning algorithm:

  • Trains on many different tasks
  • Learns patterns that help it adapt quickly to new tasks
  • Can solve new tasks with just a few examples (few-shot learning)

Properties

Property Summary
double InnerLearningRate { get; } Gets the learning rate used for task adaptation (inner loop).
double OuterLearningRate { get; } Gets the learning rate used for meta-learning (outer loop).
int AdaptationSteps { get; } Gets the number of adaptation steps to perform during task adaptation.
string AlgorithmName { get; } Gets the name of the meta-learning algorithm.

Methods

Method Summary
IFullModel<T, TInput, TOutput> GetMetaModel() Gets the base model used by this meta-learning algorithm.
IModel<TInput, TOutput, ModelMetadata<T>> Adapt(IMetaLearningTask<T, TInput, TOutput> task) Adapts the model to a new task using its support set.
T Evaluate(TaskBatch<T, TInput, TOutput> taskBatch) Evaluates the meta-learning algorithm on a batch of tasks.
T MetaTrain(TaskBatch<T, TInput, TOutput> taskBatch) Performs one meta-training step on a batch of tasks.
void SetMetaModel(IFullModel<T, TInput, TOutput> model) Sets the base model for this meta-learning algorithm.