CNPOptions<T, TInput, TOutput>
Options & Configuration · AiDotNet.MetaLearning.Options
Configuration options for Conditional Neural Process (CNP) (Garnelo et al., ICML 2018).
Inheritance: ModelOptions → CNPOptions<T, TInput, TOutput>
Implements: IMetaLearnerOptions<T>
For Beginners
CNP is the simplest neural process:
- Look at each example individually and summarize it
- Average all summaries into one global summary
- Use the global summary to predict at new points
Fast but produces independent predictions (no coherent function samples).
How It Works
CNP encodes each context pair (x,y) independently, aggregates via mean pooling, and decodes to make predictions at target points. It provides a simple, fast approach to function approximation from context sets.
Constructors
| Constructor | Summary |
|---|---|
CNPOptions(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; } |
Gets or sets the encoder/decoder 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 regression loss. |
bool EnableCheckpointing { get; set; } |
|
bool UseFirstOrder { get; set; } |
Whether to use the first-order approximation of the meta-gradient. |
double InnerLearningRate { get; set; } |
|
double OuterLearningRate { get; set; } |
|
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 NumMetaIterations { get; set; } |
|
int RepresentationDim { get; set; } |
Gets or sets the representation dimensionality. |
int? RandomSeed { get; set; } |
Methods
| Method | Summary |
|---|---|
IMetaLearnerOptions<T> Clone() |
|
bool IsValid() |