PTMAPOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for PT+MAP (Power Transform + Maximum A Posteriori) (Hu et al., ICLR 2021).
Inheritance: ModelOptions → PTMAPOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
PT+MAP is a surprisingly simple yet powerful approach:
- Extract features using any pretrained backbone
- Apply a power transform to normalize the feature distribution
- Use MAP (optimal Bayesian) estimation to classify query examples transductively
The power transform makes features more Gaussian, which makes the simple Bayesian classifier work much better. Simple math, strong results.
How It Works
PT+MAP applies power transform normalization to features followed by MAP estimation for transductive few-shot classification.
Reference: Hu, Y., Gripon, V., & Pateux, S. (2021). Leveraging the Feature Distribution in Transfer-based Few-Shot Learning. ICLR 2021.
Constructors
| Constructor | Summary |
|---|---|
PTMAPOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of PTMAPOptions. |
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 PowerTransformBeta { get; set; } |
Gets or sets the power transform exponent (beta). |
double Temperature { get; set; } |
Gets or sets the temperature for softmax in MAP estimation. |
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 MAPIterations { get; set; } |
Gets or sets the number of MAP estimation iterations. |
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() |