NPBMLAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of NPBML (Neural Process-Based Meta-Learning).

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

Implements: IGeneratedParameterRegistrar<T>

For Beginners

NPBML is a probabilistic meta-learner that knows when it’s uncertain:

Standard meta-learners: Given a support set, produce ONE adapted model that gives ONE prediction per query. You don’t know how confident the model is.

NPBML’s probabilistic approach:

  1. Encode support examples into a DISTRIBUTION (mean + variance), not a single point
  2. Sample from this distribution multiple times
  3. Each sample gives a slightly different prediction
  4. If samples agree: model is confident
  5. If samples disagree: model is uncertain about this task

Why this matters:

  • Few support examples = high uncertainty (wide distribution)
  • Many similar support examples = low uncertainty (narrow distribution)
  • Ambiguous task = high uncertainty (can’t determine the right adaptation)

Analogy: It’s like asking 5 experts (sampled from the distribution). If all 5 agree, you’re confident. If they give different answers, you know the task is ambiguous.

How It Works

NPBML combines neural processes with meta-learning for probabilistic few-shot prediction. It encodes the support set into a latent distribution and samples from it to capture task-level uncertainty.

Algorithm - NPBML:

Constructors

Constructor Summary
NPBMLAlgorithm(NPBMLOptions<T, TInput, TOutput> options) Initializes a new NPBML meta-learner.

Properties

Property Summary
MetaLearningAlgorithmType AlgorithmType { get; }

Methods

Method Summary
IModel<TInput, TOutput, ModelMetadata<T>> Adapt(IMetaLearningTask<T, TInput, TOutput> task)
T MetaTrain(TaskBatch<T, TInput, TOutput> taskBatch)