VERSAOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for VERSA (Versatile and Efficient Few-shot Learning) algorithm.
Inheritance: ModelOptions → VERSAOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
VERSA takes a completely different approach to few-shot learning:
Traditional meta-learning (MAML, etc.): “Here are 5 examples. Let me run gradient descent to learn a classifier…” (slow)
VERSA: “Here are 5 examples. single forward pass Here’s your classifier.” (instant)
How? VERSA trains a separate neural network (the “amortization network”) whose job is to look at a set of examples and immediately output the weights for a classifier. It’s like having a factory that produces customized classifiers on demand.
Key advantages:
- No inner-loop optimization at all (fastest possible adaptation)
- Naturally handles variable numbers of support examples
- The amortization network learns to extract task-relevant statistics
How It Works
VERSA uses an amortization network to produce task-specific parameters in a single forward pass, eliminating the need for inner-loop gradient descent entirely. Given support examples, the amortization network directly outputs classifier parameters.
Reference: Gordon, J., Bronskill, J., Bauer, M., Nowozin, S., & Turner, R. E. (2019). Meta-Learning Probabilistic Inference for Prediction. ICLR 2019.
Constructors
| Constructor | Summary |
|---|---|
VERSAOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of VERSAOptions. |
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; } |
|
bool UseProbabilistic { get; set; } |
Gets or sets whether to use a probabilistic (Bayesian) formulation. |
double AmortizationDropout { get; set; } |
Gets or sets the dropout rate for the amortization network. |
double InnerLearningRate { get; set; } |
|
double OuterLearningRate { get; set; } |
|
double? GradientClipThreshold { get; set; } |
|
int AdaptationSteps { get; set; } |
|
int AmortizationHiddenDim { get; set; } |
Gets or sets the hidden dimension of the amortization network. |
int AmortizationNumLayers { get; set; } |
Gets or sets the number of hidden layers in the amortization network. |
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. |
string AggregationMethod { get; set; } |
Gets or sets the aggregation method for support set features. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |