AdaptiveCompressor<T>

Models & Types ยท AiDotNet.FederatedLearning.Compression

Adaptive compressor: dynamically adjusts compression ratio per client based on bandwidth, gradient importance, and staleness.

Inheritance: FederatedLearningComponentBase<T> โ†’ AdaptiveCompressor<T>

For Beginners

In a real federation, clients have different network speeds. A phone on 5G can send more data than one on 3G. Rather than using the same compression for everyone, the adaptive compressor gives faster clients less compression (better accuracy) and slower clients more compression (saves bandwidth). It also prioritizes clients whose gradients carry more information.

How It Works

How it works:

Constructors

Constructor Summary
AdaptiveCompressor(AdvancedCompressionOptions options) Initializes a new instance of AdaptiveCompressor.

Methods

Method Summary
ValueTuple<Tensor<T>, double> Compress(Tensor<T> gradient, int clientId, int currentRound, double roundTripMs) Compresses a gradient using an adaptively determined top-k ratio.
double ComputeAdaptiveRatio(int clientId, Tensor<T> gradient, int currentRound) Gets the current adaptive compression ratio for a client.
void RecordBandwidth(int clientId, double roundTripMs) Records a bandwidth measurement for a client.