BayProNetOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.MetaLearning.Options

Configuration options for BayProNet: Bayesian Prototypical Networks for few-shot learning with uncertainty estimation.

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

Implements: IMetaLearnerOptions<T>

How It Works

BayProNet extends Prototypical Networks by modeling class prototypes as Gaussian distributions N(μ_c, σ²_c) rather than point estimates. The prototype mean and variance are computed from support set embeddings, and classification uses the expected negative log-likelihood under the prototype distribution rather than simple Euclidean distance.

Key equations:

Constructors

Constructor Summary
BayProNetOptions(IFullModel<T, TInput, TOutput> metaModel) Creates options for meta-learning metaModel, with the default settings.

Properties

Property Summary
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } Episodic data loader that supplies the meta-training tasks; null when tasks are passed to training directly.
IFullModel<T, TInput, TOutput> MetaModel { get; set; } The model whose parameters the meta-learner trains to adapt quickly to new tasks.
IGradientBasedOptimizer<T, TInput, TOutput> InnerOptimizer { get; set; } Optimizer for task adaptation.
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; } Whether to use the first-order approximation of the meta-gradient.
double InitialPrototypeLogVar { get; set; } Initial log-variance for prototype distributions.
double InnerLearningRate { get; set; }
double KLWeight { get; set; } Weight for the KL divergence between prototype posteriors and a unit Gaussian prior.
double OuterLearningRate { get; set; }
double Temperature { get; set; } Temperature scaling for the softmax over Mahalanobis distances.
double? GradientClipThreshold { get; set; }
int AdaptationSteps { get; set; }
int CheckpointFrequency { get; set; }
int EmbeddingDim { get; set; } Dimensionality of prototype embeddings.
int EvaluationFrequency { get; set; }
int EvaluationTasks { get; set; }
int MetaBatchSize { get; set; }
int NumMetaIterations { get; set; }
int? RandomSeed { get; set; }

Methods

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