BufferedAsyncFederatedTrainer<T>
Models & Types · AiDotNet.FederatedLearning.Trainers
Implements FedBuff — Buffered asynchronous federated aggregation.
Inheritance: FederatedLearningComponentBase<T> → BufferedAsyncFederatedTrainer<T>
For Beginners
In pure async FL, the server aggregates each client’s update as soon as it arrives. This can lead to “stale” updates from slow clients being applied to a model that has already moved on. FedBuff adds a buffer: the server waits until K updates arrive (from any clients), then aggregates them all at once. This balances freshness (not too stale) with efficiency (don’t wait for all clients).
How It Works
Algorithm:
Reference: Nguyen, J., et al. (2022). “Federated Learning with Buffered Asynchronous Aggregation.” AISTATS 2022.
Constructors
| Constructor | Summary |
|---|---|
BufferedAsyncFederatedTrainer(int bufferSize, double stalenessDiscount) |
Creates a new FedBuff trainer. |
Properties
| Property | Summary |
|---|---|
bool IsBufferReady { get; } |
Checks if the buffer is full and ready for aggregation. |
int BufferSize { get; } |
Gets the buffer size (K). |
int CurrentBufferCount { get; } |
Gets the current buffer count. |
int CurrentGlobalRound { get; } |
Gets the current global round. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T[]> AggregateBuffer() |
Aggregates the buffered updates with staleness-weighted averaging. |
void SubmitUpdate(int clientId, Dictionary<string, T[]> update, int clientRound) |
Submits a client update to the buffer. |