SEALOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for the SEAL (Sample-Efficient Adaptive Learning) meta-learning algorithm.
Inheritance: ModelOptions → SEALOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
SEAL learns the best starting point for a model so that it can quickly adapt to new tasks with minimal data. Think of it like learning how to learn - after seeing many tasks, the model knows how to pick up new skills quickly.
Imagine learning to play musical instruments:
- Learning your first instrument (piano) is hard
- Learning your second instrument (guitar) is easier
- By your 5th instrument, you’ve learned principles that help you
pick up any new instrument much faster
SEAL does the same with machine learning models!
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, incorporating temperature scaling, entropy regularization, and optional adaptive learning rates.
Key features of SEAL:
- 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
Constructors
| Constructor | Summary |
|---|---|
SEALOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of the SEALOptions class with the required meta-model. |
Properties
| Property | Summary |
|---|---|
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } |
Gets or sets the episodic data loader for sampling tasks. |
IFullModel<T, TInput, TOutput> MetaModel { get; set; } |
Gets or sets the meta-model to be trained. |
IGradientBasedOptimizer<T, TInput, TOutput> InnerOptimizer { get; set; } |
Optimizer for task adaptation. |
IGradientBasedOptimizer<T, TInput, TOutput> MetaOptimizer { get; set; } |
Optimizer for the meta-update. |
ILossFunction<T> LossFunction { get; set; } |
Loss function for meta-training; null uses the meta-model’s default loss. |
SEALAdaptiveLearningRateMode AdaptiveLearningRateMode { get; set; } |
Gets or sets the mode for adaptive learning rate computation. |
bool EnableCheckpointing { get; set; } |
Gets or sets whether to save checkpoints during training. |
bool EntropyOnlyDuringMetaTrain { get; set; } |
Gets or sets whether to apply entropy regularization only during meta-training. |
bool UseAdaptiveInnerLR { get; set; } |
Gets or sets whether to use adaptive inner learning rates. |
bool UseFirstOrder { get; set; } |
Gets or sets whether to use first-order approximation (FOMAML-style). |
double AdaptiveLearningRateDecay { get; set; } |
Gets or sets the decay rate for running mean in adaptive learning rates. |
double AdaptiveLearningRateEpsilon { get; set; } |
Gets or sets the epsilon value for numerical stability in adaptive learning rates. |
double EntropyCoefficient { get; set; } |
Gets or sets the entropy regularization coefficient. |
double InnerLearningRate { get; set; } |
Gets or sets the learning rate for the inner loop (task adaptation). |
double MinTemperature { get; set; } |
Gets or sets the minimum temperature for temperature annealing. |
double OuterLearningRate { get; set; } |
Gets or sets the learning rate for the outer loop (meta-optimization). |
double Temperature { get; set; } |
Gets or sets the temperature scaling factor for the loss function. |
double WeightDecay { get; set; } |
Gets or sets the weight decay (L2 regularization) coefficient. |
double? GradientClipThreshold { get; set; } |
Gets or sets the maximum gradient norm for gradient clipping. |
int AdaptationSteps { get; set; } |
Gets or sets the number of gradient steps to take during inner loop adaptation. |
int CheckpointFrequency { get; set; } |
Gets or sets how often to save checkpoints. |
int EvaluationFrequency { get; set; } |
Gets or sets how often to evaluate during meta-training. |
int EvaluationTasks { get; set; } |
Gets or sets the number of tasks to use for evaluation. |
int MetaBatchSize { get; set; } |
Gets or sets the number of tasks to sample per meta-training iteration. |
int NumMetaIterations { get; set; } |
Gets or sets the total number of meta-training iterations to perform. |
int? RandomSeed { get; set; } |
Gets or sets the random seed for reproducibility. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
Creates a deep copy of the SEAL options. |
bool IsValid() |
Validates that all SEAL configuration options are properly set. |