FRNOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for FRN (Few-shot Classification via Feature Map Reconstruction) (Wertheimer et al., CVPR 2021).
Inheritance: ModelOptions → FRNOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
FRN asks “can I rebuild this query from the support set?”:
- For each class, collect support feature maps
- Try to reconstruct the query’s feature map using ONLY features from class k
- If reconstruction is good (low error): query likely belongs to class k
- If reconstruction is bad (high error): query likely NOT class k
It’s like asking: “Can I explain this new image using only the patterns I’ve seen from cats?” If yes, it’s probably a cat. If not, try the next class.
How It Works
FRN classifies queries by reconstructing their feature maps from class-specific support feature maps. The reconstruction error serves as the distance metric.
Reference: Wertheimer, D., Tang, L., & Hariharan, B. (2021). Few-Shot Classification With Feature Map Reconstruction Networks. CVPR 2021.
Constructors
| Constructor | Summary |
|---|---|
FRNOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of FRNOptions. |
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 ReconstructionLambda { get; set; } |
Gets or sets the reconstruction regularization parameter (lambda). |
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 NumComponents { get; set; } |
Gets or sets the number of reconstruction components per class. |
int NumMetaIterations { get; set; } |
|
int? RandomSeed { get; set; } |
Gets or sets the random seed. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |