FedAGHNPersonalization<T>
Models & Types · AiDotNet.FederatedLearning.Personalization
Implements FedAGHN (Adaptive Gradient-based Heterogeneous Networks) personalization.
Inheritance: FederatedLearningComponentBase<T> → FedAGHNPersonalization<T>
For Beginners
In standard FL, all clients must use the same model architecture. FedAGHN relaxes this: each client can have a differently-sized model (e.g., a phone uses a small model, a workstation uses a large one). It works by defining a shared “knowledge representation” space and learning adapter layers that project each client’s heterogeneous model into this shared space for aggregation. Gradient similarity across the shared space determines aggregation weights adaptively.
How It Works
Architecture:
Reference: FedAGHN: Adaptive Gradient Heterogeneous Networks for FL (2024).
Constructors
| Constructor | Summary |
|---|---|
FedAGHNPersonalization(int sharedDimension, double adaptiveWeightMomentum) |
Creates a new FedAGHN personalization strategy. |
Properties
| Property | Summary |
|---|---|
double AdaptiveWeightMomentum { get; } |
Gets the adaptive weight momentum. |
int SharedDimension { get; } |
Gets the shared knowledge space dimension. |
Methods
| Method | Summary |
|---|---|
Dictionary<int, T> ComputeAdaptiveWeights(T[] targetGradient, Dictionary<int, T[]> clientGradients, Dictionary<int, T> previousWeights) |
Computes adaptive aggregation weights for a target client based on gradient similarity with all other clients. |
T ComputeGradientSimilarity(T[] gradA, T[] gradB) |
Computes gradient similarity between two clients in the shared space using cosine similarity. |
T[] ProjectToLocal(T[] sharedParams, int localDimension) |
Projects shared-space parameters back to client’s local dimension. |
T[] ProjectToShared(T[] localParams) |
Projects client parameters from local dimension to shared space for aggregation. |
T[] ProjectWithMatrix(T[] localParams, T[] projectionMatrix) |
Projects client parameters using a learned linear projection matrix rather than truncation. |