IContinualLearnerConfig<T>
Interfaces · AiDotNet.ContinualLearning.Interfaces
Configuration interface for continual learning algorithms.
Known implementations: ContinualLearnerConfig<T>
For Beginners
This interface defines the settings needed for continual learning, such as learning rates, memory constraints, and regularization parameters.
How It Works
Continual Learning is the ability to learn new tasks sequentially without forgetting previously learned knowledge. This is challenging because neural networks tend to suffer from “catastrophic forgetting” - learning new information overwrites old knowledge.
Common Strategies Include:
- EWC (Elastic Weight Consolidation): Protects important weights from changing
- LwF (Learning without Forgetting): Uses knowledge distillation from teacher model
- GEM (Gradient Episodic Memory): Projects gradients to prevent forgetting
- SI (Synaptic Intelligence): Tracks online importance of weights
- Experience Replay: Stores and replays examples from previous tasks
Reference: Parisi et al. “Continual Lifelong Learning with Neural Networks: A Review” (2019)
Properties
| Property | Summary |
|---|---|
MemorySamplingStrategy MemoryStrategy { get; } |
Memory sampling strategy. |
T AGemMargin { get; } |
Margin for A-GEM (Averaged GEM). |
T BiCValidationFraction { get; } |
Validation set fraction for BiC bias correction. |
T DistillationTemperature { get; } |
Temperature for knowledge distillation softmax. |
T DistillationWeight { get; } |
Weight for distillation loss vs task loss. |
T EwcLambda { get; } |
EWC regularization strength (lambda). |
T GemMemoryStrength { get; } |
Memory strength for GEM constraint. |
T GradientClipNorm { get; } |
Gradient clipping max norm. |
T HatSmax { get; } |
Smax value for gradient-based attention. |
T HatSparsity { get; } |
Sparsity coefficient for HAT. |
T LearningRate { get; } |
Learning rate for training. |
T MasLambda { get; } |
MAS regularization coefficient (lambda). |
T OnlineEwcGamma { get; } |
Decay factor for online EWC (gamma). |
T PackNetPruneRatio { get; } |
Pruning ratio for PackNet. |
T PnnLateralScaling { get; } |
Lateral connection scaling factor. |
T SiC { get; } |
SI regularization coefficient (c). |
T SiXi { get; } |
SI dampening factor (xi). |
T WeightDecay { get; } |
Weight decay coefficient. |
bool ComputeBackwardTransfer { get; } |
Compute backward transfer metric. |
bool ComputeForwardTransfer { get; } |
Compute forward transfer metric. |
bool ICarlUseHerding { get; } |
Use herding for exemplar selection. |
bool NormalizeFisher { get; } |
Normalize Fisher Information matrix. |
bool PnnUseLateralConnections { get; } |
Use lateral connections in progressive networks. |
bool UseEmpiricalFisher { get; } |
Use empirical Fisher (gradient squared) vs true Fisher. |
bool UseGradientClipping { get; } |
Enable gradient clipping. |
bool UsePrioritizedReplay { get; } |
Use prioritized experience replay based on sample importance. |
bool UseSoftTargets { get; } |
Use soft targets from teacher model. |
bool UseWeightDecay { get; } |
Enable weight decay regularization. |
int AGemReferenceGradients { get; } |
Number of reference gradients for A-GEM. |
int BatchSize { get; } |
Batch size for training. |
int EpochsPerTask { get; } |
Number of training epochs per task. |
int EvaluationFrequency { get; } |
Evaluation frequency (every N epochs). |
int FisherSamples { get; } |
Number of samples for Fisher Information computation. |
int ICarlExemplarsPerClass { get; } |
Number of exemplars per class for iCaRL. |
int MaxTasks { get; } |
Maximum number of tasks to support. |
int MemorySize { get; } |
Maximum number of examples to store from previous tasks. |
int PackNetRetrainEpochs { get; } |
Retrain epochs after pruning. |
int SamplesPerTask { get; } |
Number of samples per task to store in memory. |
int? RandomSeed { get; } |
Random seed for reproducibility. |
Methods
| Method | Summary |
|---|---|
bool IsValid() |
Validates the configuration. |