MetaBaselineOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.MetaLearning.Options

Configuration options for Meta-Baseline (Chen et al., ICLR 2021).

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

Implements: IMetaLearnerOptions<T>

For Beginners

Meta-Baseline is a “simple but strong” approach:

Phase 1: Pre-training Train a classifier normally on all base classes (standard cross-entropy). This produces a strong feature extractor.

Phase 2: Meta-training Fine-tune with episodic training using cosine similarity to class centroids. This adapts the features for few-shot nearest-centroid classification.

Why it’s effective: A well-pretrained backbone provides excellent features. The meta-training phase just polishes them for the nearest-centroid setting.

How It Works

Meta-Baseline first pre-trains a feature extractor with standard classification, then meta-trains with cosine-similarity-based nearest-centroid classification. This two-phase approach provides a strong baseline that outperforms many complex methods.

Reference: Chen, Y., Liu, Z., Xu, H., Darrell, T., & Wang, X. (2021). Meta-Baseline: Exploring Simple Meta-Learning for Few-Shot Learning. ICLR 2021.

Constructors

Constructor Summary
MetaBaselineOptions(IFullModel<T, TInput, TOutput> metaModel) Initializes a new instance of MetaBaselineOptions.

Properties

Property Summary
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } Gets or sets the episodic data loader.
IFullModel<T, TInput, TOutput> MetaModel { get; set; } Gets or sets the feature extractor model.
IGradientBasedOptimizer<T, TInput, TOutput> InnerOptimizer { get; set; } Must stay null: this algorithm takes no plain gradient inner step (it adapts without one, or by its own update rule), so a supplied optimizer is rejected when the learner is built.
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; }
double InnerLearningRate { get; set; }
double OuterLearningRate { get; set; }
double Temperature { get; set; } Gets or sets the temperature for cosine similarity scaling.
double? GradientClipThreshold { get; set; }
int AdaptationSteps { get; set; } Number of gradient steps taken on each task’s support set (0: this algorithm adapts without gradient steps).
int CheckpointFrequency { get; set; }
int EvaluationFrequency { get; set; }
int EvaluationTasks { get; set; }
int MetaBatchSize { get; set; }
int NumMetaIterations { get; set; }
int? RandomSeed { get; set; } Gets or sets the random seed.

Methods

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