MASTrainer<T, TInput, TOutput>

Models & Types · AiDotNet.ContinualLearning.Trainers

Continual learning trainer using Memory Aware Synapses (MAS).

Inheritance: ContinualLearnerBase<T, TInput, TOutput> → MASTrainer<T, TInput, TOutput>

For Beginners

This trainer implements continual learning using MAS, which prevents catastrophic forgetting by measuring how sensitive the network output is to each parameter. The key advantage is that MAS is unsupervised - it doesn’t need task labels, just input data!

How It Works

How MAS Works:

MAS Regularization:

Where Ω_i is the accumulated importance and θ*_i are the optimal parameters.

Key Advantages over EWC:

Usage Example:

Reference: Aljundi et al. “Memory Aware Synapses: Learning what (not) to forget” (ECCV 2018)

Constructors

Constructor Summary
MASTrainer(IFullModel<T, TInput, TOutput> model, ILossFunction<T> lossFunction, IContinualLearnerConfig<T> config, IContinualLearningStrategy<T, TInput, TOutput> strategy) Initializes a new MAS trainer with default options.
MASTrainer(IFullModel<T, TInput, TOutput> model, ILossFunction<T> lossFunction, IContinualLearnerConfig<T> config, IContinualLearningStrategy<T, TInput, TOutput> strategy, MASTrainerOptions<T> options) Initializes a new MAS trainer with custom options.

Properties

Property Summary
MemoryAwareSynapses<T, TInput, TOutput> MASStrategy { get; } Gets the MAS-specific strategy if available.