DataFreeFCL<T>
Models & Types · AiDotNet.FederatedLearning.ContinualLearning
Implements Data-Free Federated Continual Learning — prevents forgetting without storing real data.
Inheritance: FederatedLearningComponentBase<T> → DataFreeFCL<T>
Implements: IFederatedContinualLearningStrategy<T>
For Beginners
Most continual learning methods require storing old training data (replay buffers) to remember previous tasks. This is a problem in federated learning because clients may not be allowed to store data (privacy constraints, storage limits). Data-Free FCL instead uses the global model itself to generate synthetic “pseudo-samples” that capture knowledge of previous tasks. These synthetic samples are used during training on new tasks to prevent forgetting, without ever storing or sharing real client data.
How It Works
Algorithm:
Reference: Data-Free Federated Continual Learning (2024). Extends Luo et al., “Data-Free Knowledge Distillation for Heterogeneous FL,” NeurIPS 2023.
Constructors
| Constructor | Summary |
|---|---|
DataFreeFCL(double distillationTemperature, double distillationWeight, int syntheticSamplesPerClass, int generationSteps) |
Creates a new Data-Free FCL strategy. |
Properties
| Property | Summary |
|---|---|
double DistillationTemperature { get; } |
Gets the distillation temperature. |
double DistillationWeight { get; } |
Gets the distillation weight. |
int GenerationSteps { get; } |
Gets the number of generation optimization steps. |
int SyntheticSamplesPerClass { get; } |
Gets the number of synthetic samples per class. |
Methods
| Method | Summary |
|---|---|
Dictionary<int, List<double[]>> GenerateSyntheticData(Func<double[], double[]> teacherLogitsFn, int numClasses, int inputDim, int seed) |
Generates synthetic pseudo-samples that activate the teacher model’s knowledge for a target class. |
T ComputeDistillationLoss(Vector<T> teacherLogits, Vector<T> studentLogits) |
Computes the knowledge distillation loss between teacher and student soft predictions. |
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> ComputeImportance(Vector<T> modelParameters, Matrix<T> taskData) |
|
Vector<T> ProjectGradient(Vector<T> gradient, Vector<T> importanceWeights) |