DriftAdaptiveAggregator<T>
Models & Types ยท AiDotNet.FederatedLearning.DriftDetection
Drift-adaptive aggregator: wraps any aggregation strategy and adjusts weights based on drift.
Inheritance: FederatedLearningComponentBase<T> โ DriftAdaptiveAggregator<T>
For Beginners
In standard FedAvg, all clients get weight proportional to their data size. But if some clients are experiencing concept drift (their data has changed), their updates may hurt the global model. This aggregator detects drifting clients and reduces their influence while boosting stable clients.
How It Works
How it works:
Integration: Use this as a wrapper around your existing aggregation strategy. It modifies the weights before aggregation happens.
Constructors
| Constructor | Summary |
|---|---|
DriftAdaptiveAggregator(FederatedDriftOptions options, IFederatedDriftDetector<T> detector) |
Initializes a new instance of DriftAdaptiveAggregator. |
Properties
| Property | Summary |
|---|---|
DriftReport LatestReport { get; } |
Gets the latest drift report. |
Methods
| Method | Summary |
|---|---|
HashSet<int> GetClientsNeedingRetraining() |
Gets clients that need selective retraining. |
HashSet<int> GetDriftingClients() |
Gets the set of currently drifting client IDs. |
ValueTuple<DriftReport, Dictionary<int, double>> ProcessRound(int round, Dictionary<int, Tensor<T>> clientModels, Tensor<T> globalModel, Dictionary<int, double> clientMetrics, Dictionary<int, double> originalWeights) |
Processes a round of FL by detecting drift and computing adaptive weights. |
void Reset() |
Resets all drift detection state. |