MetaLoRAOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.MetaLearning.Options

Configuration options for Meta-LoRA (Low-Rank Adaptation for Meta-Learning).

Inheritance: ModelOptions → MetaLoRAOptions<T, TInput, TOutput>

Implements: IMetaLearnerOptions<T>

How It Works

Meta-LoRA applies the Low-Rank Adaptation principle to meta-learning: instead of adapting all model parameters during the inner loop (as in MAML), it meta-learns a set of low-rank basis vectors and only adapts a small number of coefficients per task. This drastically reduces the inner-loop parameter count from d to r (where r << d).

Key Parameters:

  • Rank — number of low-rank basis vectors (controls capacity vs efficiency)
  • ScalingAlpha — scales the LoRA update magnitude (analogous to alpha/r in standard LoRA)

Constructors

Constructor Summary
MetaLoRAOptions(IFullModel<T, TInput, TOutput> metaModel) Creates options for meta-learning metaModel, with the default settings.

Properties

Property Summary
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } Episodic data loader that supplies the meta-training tasks; null when tasks are passed to training directly.
IFullModel<T, TInput, TOutput> MetaModel { get; set; } The model whose parameters the meta-learner trains to adapt quickly to new tasks.
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 default multi-class classification loss.
bool EnableCheckpointing { get; set; }
bool UseFirstOrder { get; set; } Whether to use the first-order approximation of the meta-gradient.
double BasisInitStdDev { get; set; } Standard deviation for initializing the low-rank basis vectors.
double InnerLearningRate { get; set; }
double OuterLearningRate { get; set; }
double ScalingAlpha { get; set; } Scaling factor applied to the LoRA update: adapted = base + (alpha / rank) * sum(c_i * v_i).
double? GradientClipThreshold { get; set; }
int AdaptationSteps { get; set; }
int CheckpointFrequency { get; set; }
int EvaluationFrequency { get; set; }
int EvaluationTasks { get; set; }
int MetaBatchSize { get; set; }
int NumMetaIterations { get; set; }
int Rank { get; set; } Number of low-rank basis vectors used for adaptation.
int? RandomSeed { get; set; }

Methods

Method Summary
IMetaLearnerOptions<T> Clone()
bool IsValid()