MANNAlgorithm<T, TInput, TOutput>

Models & Types · AiDotNet.MetaLearning.Algorithms

Implementation of Memory-Augmented Neural Networks (MANN) for meta-learning.

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

Implements: IGeneratedParameterRegistrar<T>

For Beginners

MANN uses an external memory like a human’s working memory:

How it works:

  1. Neural network processes input and produces a key
  2. Uses key to read relevant information from external memory
  3. Combines input with memory content to make prediction
  4. During learning, writes new information to memory
  5. Memory persists across episodes for lifelong learning

Analogy: Like a student with a notebook who can:

  • Look up previous examples (reading memory)
  • Write down new important information (writing memory)
  • Use both to solve new problems

How It Works

Memory-Augmented Neural Networks combine a neural network with an external memory matrix. The network can read from and write to this memory, enabling rapid learning by storing new information directly in memory during adaptation.

Algorithm - Memory-Augmented Neural Networks:

Key Insights:

  1. Rapid Learning: New information can be stored in memory with a single

write operation, enabling one-shot learning.

  1. Continuous Learning: Memory persists across episodes, allowing the

model to accumulate knowledge over time.

  1. Differentiable Memory: Both reading and writing operations are

differentiable, enabling end-to-end training.

Reference: Santoro, A., Bartunov, S., Botvinick, M., Wierstra, D., & Lillicrap, T. (2016). Meta-Learning with Memory-Augmented Neural Networks. ICML.

Constructors

Constructor Summary
MANNAlgorithm(MANNOptions<T, TInput, TOutput> options) Initializes a new instance of the MANNAlgorithm class.

Properties

Property Summary
MetaLearningAlgorithmType AlgorithmType { get; } Gets the algorithm type identifier for this meta-learner.

Methods

Method Summary
IModel<TInput, TOutput, ModelMetadata<T>> Adapt(IMetaLearningTask<T, TInput, TOutput> task) Adapts to a new task by writing support examples to a copy of the memory.
ModelOptions GetOptions()
T MetaTrain(TaskBatch<T, TInput, TOutput> taskBatch) Performs one meta-training step using MANN’s episodic training with memory.