NPBMLOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for NPBML (Neural Process-Based Meta-Learning).
Inheritance: ModelOptions → NPBMLOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
NPBML is a probabilistic meta-learner:
- Encodes support examples into a latent distribution (not just a point)
- Samples from this distribution to capture task uncertainty
- Decodes predictions for query examples using the sampled task representation
This means NPBML can say “I’m not sure about this task” by producing high-variance predictions when the support set is ambiguous.
How It Works
NPBML combines neural processes with meta-learning for probabilistic few-shot prediction. It models the predictive distribution conditioned on the support set using a stochastic latent variable that captures task-level uncertainty.
Constructors
| Constructor | Summary |
|---|---|
NPBMLOptions(IFullModel<T, TInput, TOutput> metaModel) |
Initializes a new instance of NPBMLOptions. |
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 KLWeight { get; set; } |
Gets or sets the KL divergence weight. |
double OuterLearningRate { get; set; } |
|
double? GradientClipThreshold { get; set; } |
|
int AdaptationSteps { get; set; } |
Number of gradient steps taken on each task’s support set. |
int CheckpointFrequency { get; set; } |
|
int EvaluationFrequency { get; set; } |
|
int EvaluationTasks { get; set; } |
|
int LatentDim { get; set; } |
Gets or sets the latent dimension for the task representation. |
int MetaBatchSize { get; set; } |
|
int NumMetaIterations { get; set; } |
|
int NumSamples { get; set; } |
Gets or sets the number of samples for prediction averaging. |
int? RandomSeed { get; set; } |
Gets or sets the random seed. |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |