NeuralProcessBase<T, TInput, TOutput>

Base Classes · AiDotNet.MetaLearning.Algorithms

Base class for the Neural Process family of meta-learning algorithms. Provides shared infrastructure for encoding context sets, aggregating representations, and decoding target predictions.

Inheritance: ModelBase<T, TInput, TOutput> → MetaLearnerBase<T, TInput, TOutput> → NeuralProcessBase<T, TInput, TOutput>

Known derived types: ANPAlgorithm<T, TInput, TOutput>, CNPAlgorithm<T, TInput, TOutput>, ConvCNPAlgorithm<T, TInput, TOutput>, ConvNPAlgorithm<T, TInput, TOutput>, EquivCNPAlgorithm<T, TInput, TOutput>, LBANPAlgorithm<T, TInput, TOutput>, NPAlgorithm<T, TInput, TOutput>, RCNPAlgorithm<T, TInput, TOutput>, SteerCNPAlgorithm<T, TInput, TOutput>, SwinTNPAlgorithm<T, TInput, TOutput>, TETNPAlgorithm<T, TInput, TOutput>, TNPAlgorithm<T, TInput, TOutput>

For Beginners

Neural Processes are like learning a recipe for making predictions:

  1. Context set = examples you’ve already seen (like support set in few-shot learning)
  2. Encoder = summarizes what you’ve seen into a compact representation
  3. Aggregator = combines individual summaries into one global summary
  4. Decoder = uses the summary to make predictions at new points

Different NP variants differ in how they encode, aggregate, and decode:

  • CNP: Simple mean aggregation, point predictions
  • NP: Adds a latent variable for uncertainty
  • ANP: Adds attention for better predictions

How It Works

Neural Processes (NPs) are a family of models that define a distribution over functions. They encode a context set (observed points) into a representation and use it to make predictions at target points. Unlike gradient-based meta-learners (MAML), NPs perform adaptation through a single forward pass via amortized inference.