MetaDiffAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of MetaDiff: Meta-Learning with Conditional Diffusion for Few-Shot Learning (Zhang et al., AAAI 2024).

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

Implements: IGeneratedParameterRegistrar<T>

How It Works

MetaDiff replaces the gradient-based inner loop of MAML with a learned diffusion-based denoising process. Starting from Gaussian noise, a task-conditional denoising network (TCUNet) iteratively produces task-specific weight parameters. The key insight is that gradient descent (random init → optimal weights) is analogous to the diffusion reverse process (noise → clean signal).

Algorithm:

Key advantage: GPU memory is constant regardless of adaptation steps (unlike MAML which scales linearly). The denoising process can be run for as many steps as desired without backpropagating through the full chain.

Constructors

Constructor Summary
MetaDiffAlgorithm(MetaDiffOptions<T, TInput, TOutput> options)

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)