FedAGCContinualLearning<T>

Models & Types · AiDotNet.FederatedLearning.ContinualLearning

Implements FedAGC — Adaptive Gradient Correction for federated continual learning.

Inheritance: FederatedLearningComponentBase<T> → FedAGCContinualLearning<T>

Implements: IFederatedContinualLearningStrategy<T>

For Beginners

When a federated model learns new tasks, it tends to forget old ones (catastrophic forgetting). FedAGC adaptively corrects the gradient during training: it identifies which gradient directions would harm old task performance and reduces their magnitude, while allowing gradients that help the new task without hurting old tasks to pass through freely. The correction strength adapts based on how much conflict exists between old and new task gradients.

How It Works

Correction:

Reference: FedAGC: Adaptive Gradient Correction for Federated Continual Learning (2024).

Constructors

Constructor Summary
FedAGCContinualLearning(double correctionStrength) Creates a new FedAGC strategy.

Properties

Property Summary
Vector<T> AccumulatedImportance { get; } Gets the accumulated importance from all previous tasks.
double CorrectionStrength { get; } Gets the correction strength.

Methods

Method Summary
T ComputeRegularizationPenalty(Vector<T> currentParameters, Vector<T> referenceParameters, Vector<T> importanceWeights, double regularizationStrength)
Vector<T> AggregateImportance(Dictionary<int, Vector<T>> clientImportances, Dictionary<int, double> clientWeights)
Vector<T> ComputeAdaptiveCorrectionStrength(Vector<T> gradient, Vector<T> importanceWeights) Computes adaptive per-parameter correction strength based on how important each parameter is for old tasks vs how much the new task gradient wants to change it.
Vector<T> ComputeImportance(Vector<T> modelParameters, Matrix<T> taskData)
Vector<T> ProjectGradient(Vector<T> gradient, Vector<T> importanceWeights)
Vector<T> ProjectGradientAdaptive(Vector<T> gradient, Vector<T> importanceWeights, Vector<T> adaptiveStrengths) Projects gradient using adaptive per-parameter correction strengths.