SEALAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of the SEAL (Sample-Efficient Adaptive Learning) meta-learning algorithm.

Inheritance: ModelBase<T, TInput, TOutput> → MetaLearnerBase<T, TInput, TOutput> → SEALAlgorithm<T, TInput, TOutput>

Implements: IGeneratedParameterRegistrar<T>

For Beginners

SEAL learns the best starting point for a model so that it can quickly adapt to new tasks with minimal data.

Imagine learning to play musical instruments:

  • Learning your first instrument (e.g., piano) is hard
  • Learning your second instrument (e.g., guitar) is easier
  • By the time you learn your 5th instrument, you’ve learned principles of music

that help you pick up new instruments much faster

SEAL does the same with machine learning models - it learns from many tasks to find a great starting point that makes adapting to new tasks much faster.

How It Works

SEAL is a gradient-based meta-learning algorithm that combines ideas from MAML with sample-efficiency improvements. It learns initial parameters that can be quickly adapted to new tasks with just a few examples.

Key Features:

  • Temperature scaling: Controls confidence in predictions during meta-training
  • Entropy regularization: Encourages diverse predictions to prevent overconfident models
  • Adaptive learning rates: Per-parameter learning rate adaptation based on gradient norms
  • Weight decay: Prevents overfitting to meta-training tasks

Algorithm:

  1. Sample a batch of tasks
  2. For each task:

a. Clone the meta-model b. Adapt to the task using support set (inner loop) c. Evaluate on query set to compute meta-loss d. Apply temperature scaling and entropy regularization e. Compute meta-gradients

  1. Average meta-gradients across tasks
  2. Apply weight decay and update meta-parameters

Reference: Based on gradient-based meta-learning with additional efficiency improvements including temperature scaling and entropy regularization.

Constructors

Constructor Summary
SEALAlgorithm(SEALOptions<T, TInput, TOutput> options) Initializes a new instance of the SEALAlgorithm class.

Properties

Property Summary
MetaLearningAlgorithmType AlgorithmType { get; } Gets the algorithm type identifier for this meta-learner.

Methods

Method Summary
IModel<TInput, TOutput, ModelMetadata<T>> Adapt(IMetaLearningTask<T, TInput, TOutput> task) Adapts the meta-learned model to a new task using gradient descent.
T MetaTrain(TaskBatch<T, TInput, TOutput> taskBatch) Performs one meta-training step using SEAL’s sample-efficient approach.