Class FedDynHeterogeneityCorrection<T>
- Namespace
- AiDotNet.FederatedLearning.Heterogeneity
- Assembly
- AiDotNet.dll
FedDyn-style dynamic regularization using a per-client drift accumulator.
public sealed class FedDynHeterogeneityCorrection<T> : FederatedHeterogeneityCorrectionBase<T>, IFederatedHeterogeneityCorrection<T>
Type Parameters
TNumeric type.
- Inheritance
-
FedDynHeterogeneityCorrection<T>
- Implements
- Inherited Members
Remarks
For Beginners: FedDyn reduces client drift by maintaining an extra per-client state that accumulates how the client tends to move away from the global model.
Constructors
FedDynHeterogeneityCorrection(double)
public FedDynHeterogeneityCorrection(double alpha = 0.01)
Parameters
alphadouble
Methods
Correct(int, int, Vector<T>, Vector<T>, int)
Returns corrected client parameters to be used for aggregation.
public override Vector<T> Correct(int clientId, int roundNumber, Vector<T> globalParameters, Vector<T> localParameters, int localEpochs)
Parameters
clientIdintClient identifier.
roundNumberintRound number (0-indexed).
globalParametersVector<T>Global parameter vector at the start of the round.
localParametersVector<T>Client-trained parameter vector.
localEpochsintLocal epochs used for training (proxy for local steps in simulation).
Returns
- Vector<T>
Corrected parameters.
GetCorrectionName()
Gets the name of the correction method.
public override string GetCorrectionName()