MANNOptions<T, TInput, TOutput>

Options & Configuration · AiDotNet.MetaLearning.Options

Configuration options for Memory-Augmented Neural Networks (MANN) algorithm.

Inheritance: ModelOptions → MANNOptions<T, TInput, TOutput>

Implements: IMetaLearnerOptions<T>

For Beginners

MANN is like a neural network with a notebook:

  1. The “controller” (neural network) processes inputs
  2. The “memory” stores important information for later
  3. Read heads retrieve relevant memories
  4. Write heads store new information

This allows one-shot learning - see an example once, store it, use it later!

How It Works

Memory-Augmented Neural Networks combine a neural network controller 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.

Constructors

Constructor Summary
MANNOptions(IFullModel<T, TInput, TOutput> metaModel) Initializes a new instance of the MANNOptions class with the required meta-model.

Properties

Property Summary
IEpisodicDataLoader<T, TInput, TOutput> DataLoader { get; set; } Gets or sets the episodic data loader for sampling tasks.
IFullModel<T, TInput, TOutput> MetaModel { get; set; } Gets or sets the meta-model (controller network) to be trained.
IGradientBasedOptimizer<T, TInput, TOutput> MetaOptimizer { get; set; } Optimizer for the meta-update.
ILossFunction<T> LossFunction { get; set; } Loss function for meta-training; null uses cross-entropy over logits.
bool ClearMemoryBetweenTasks { get; set; } Gets or sets whether to clear memory between tasks.
bool EnableCheckpointing { get; set; } Gets or sets whether to save model checkpoints.
bool UseCommonPatternsInitialization { get; set; } Gets or sets whether to initialize with common patterns.
bool UseFirstOrder { get; set; } Gets or sets whether to use first-order approximation.
bool UseHierarchicalMemory { get; set; } Gets or sets whether to use hierarchical memory organization.
bool UseMemoryConsolidation { get; set; } Gets or sets whether to use memory consolidation.
bool UseMemoryPreInitialization { get; set; } Gets or sets whether to pre-initialize memory.
bool UseOutputSoftmax { get; set; } Gets or sets whether predictions are the softmax of the output layer’s logits (otherwise the raw logits).
bool UseValueProjection { get; set; } Gets or sets whether to project values before storing.
double InnerLearningRate { get; set; } Gets or sets the learning rate for the inner loop (not used in MANN).
double MemoryRegularization { get; set; } Gets or sets the memory regularization strength.
double MemoryRetentionRatio { get; set; } Gets or sets the ratio of memory to retain when clearing.
double MemoryUsageThreshold { get; set; } Gets or sets the threshold for memory usage when consolidating.
double OuterLearningRate { get; set; } Gets or sets the learning rate for the outer loop (controller training).
double UsageDecay { get; set; } Gets or sets the decay gamma of the least-recently-used access (LRUA) usage weights.
double WriteGateLogit { get; set; } Gets or sets the initial value of alpha, the learned logit of the LRUA write gate sigmoid(alpha).
double? GradientClipThreshold { get; set; } Gets or sets the maximum gradient norm for gradient clipping.
int AdaptationSteps { get; set; } Gets or sets the number of adaptation steps.
int CheckpointFrequency { get; set; } Gets or sets how often to save checkpoints.
int EvaluationFrequency { get; set; } Gets or sets how often to evaluate the meta-learner.
int EvaluationTasks { get; set; } Gets or sets the number of tasks to use for evaluation.
int MemoryKeySize { get; set; } Gets or sets the dimension of memory keys.
int MemorySize { get; set; } Gets or sets the number of memory slots.
int MemoryValueSize { get; set; } Gets or sets the dimension of memory values.
int MetaBatchSize { get; set; } Gets or sets the number of tasks to sample per meta-training iteration.
int NumClasses { get; set; } Gets or sets the number of output classes.
int NumMetaIterations { get; set; } Gets or sets the total number of meta-training iterations.
int NumReadHeads { get; set; } Gets or sets the number of read heads.
int NumWriteHeads { get; set; } Gets or sets the number of write heads.
int? RandomSeed { get; set; } Gets or sets the random seed for reproducibility.
object ReadHeadOptions { get; set; } Gets or sets options for the read head configuration.
object WriteHeadOptions { get; set; } Gets or sets options for the write head configuration.

Methods

Method Summary
IMetaLearnerOptions<T> Clone() Creates a deep copy of the MANN options.
bool IsValid() Validates that all MANN configuration options are properly set.