iMAMLOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for iMAML (Implicit Model-Agnostic Meta-Learning) algorithm.
Inheritance: ModelOptions → iMAMLOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
iMAML is a more memory-efficient version of MAML. Regular MAML needs to remember every adaptation step (expensive!). iMAML uses a mathematical trick to get the same result with constant memory.
How It Works
iMAML extends MAML by using implicit differentiation to compute meta-gradients, which allows for many more adaptation steps without increased memory usage.
Key parameters specific to iMAML:
- LambdaRegularization: Controls stability of implicit gradient computation
- ConjugateGradientIterations: How many CG steps to solve the implicit equation
- ConjugateGradientTolerance: When to stop CG early if converged
Constructors
| Constructor | Summary |
|---|---|
iMAMLOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of the iMAMLOptions 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. |
bool EnableCheckpointing { get; set; } |
Gets or sets whether to save checkpoints during training. |
bool UseFirstOrder { get; set; } |
Gets or sets whether to use first-order approximation. |
bool UseNeumannApproximation { get; set; } |
Gets or sets whether to use the Neumann series approximation for implicit gradients. |
double ConjugateGradientTolerance { get; set; } |
Gets or sets the convergence tolerance for Conjugate Gradient. |
double InnerLearningRate { get; set; } |
Gets or sets the learning rate for the inner loop (task adaptation). |
double LambdaRegularization { get; set; } |
Gets or sets the strength lambda of iMAML’s proximal regularizer. |
double OuterLearningRate { get; set; } |
Gets or sets the learning rate for the outer loop (meta-optimization). |
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 ConjugateGradientIterations { get; set; } |
Gets or sets the maximum number of Conjugate Gradient iterations. |
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 NeumannSeriesTerms { get; set; } |
Gets or sets the number of terms in the Neumann series approximation. |
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 iMAML options. |
bool IsValid() |
Validates that all iMAML configuration options are properly set. |