ReptileOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.MetaLearning.Options

Configuration options for the Reptile meta-learning algorithm.

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

Implements: IMetaLearnerOptions<T>

For Beginners

Reptile is the simplest meta-learning algorithm to understand:

  1. Train on a task for several steps
  2. Move the starting point slightly toward where you ended up
  3. Repeat with many tasks

After seeing many tasks, your starting point becomes great for learning any new task!

How It Works

Reptile is a simple first-order meta-learning algorithm that doesn’t require computing gradients through the adaptation process. Instead, it interpolates between current meta-parameters and adapted parameters.

Key difference from MAML: Reptile doesn’t compute gradients through adaptation. This makes it much simpler to implement and faster to run, with competitive performance.

Constructors

Constructor Summary
ReptileOptions(IFullModel<T, TInput, TOutput> metaModel) Initializes a new instance of the ReptileOptions 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; } Gets or sets the optimizer for meta-parameter updates (outer loop).
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 UseSerialUpdate { get; set; } Gets or sets whether to use the serial (single-task) or batched update variant.
double InnerLearningRate { get; set; } Gets or sets the learning rate for the inner loop (task adaptation).
double Interpolation { get; set; } Gets or sets the interpolation factor for meta-updates.
double OuterLearningRate { get; set; } Gets or sets the learning rate for the outer loop (meta-update).
double? FinalOuterLearningRate { get; set; } Gets or sets the outer step size that OuterLearningRate anneals to over training.
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 InnerBatches { get; set; } Gets or sets the number of inner batches per adaptation step.
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 Reptile options.
bool IsValid() Validates that all Reptile configuration options are properly set.