FedRoDPersonalization<T>
Models & Types · AiDotNet.FederatedLearning.Personalization
Implements FedRoD (Representation on Demand) personalization with dual classifiers.
Inheritance: FederatedLearningComponentBase<T> → FedRoDPersonalization<T>
For Beginners
FedRoD trains two classification heads on top of a shared feature extractor: a generic head (aggregated globally, works well on average) and a personalized head (kept locally, works well on this client’s data). At inference time, the client can choose to use either head or combine their predictions depending on whether the input is more like global data or local data.
How It Works
Architecture:
Reference: Chen, H.-Y. & Chao, W.-L. (2023). “On Bridging Generic and Personalized Federated Learning for Image Classification.” ICLR 2023.
Constructors
| Constructor | Summary |
|---|---|
FedRoDPersonalization(double headFraction, double mixingAlpha) |
Creates a new FedRoD personalization strategy. |
Properties
| Property | Summary |
|---|---|
double HeadFraction { get; } |
Gets the head fraction. |
double MixingAlpha { get; } |
Gets the mixing weight for generic head. |
Methods
| Method | Summary |
|---|---|
Dictionary<string, T[]> ExtractGenericHead(Dictionary<string, T[]> fullParameters) |
Extracts the generic head parameters (aggregated with the body). |
Dictionary<string, T[]> ExtractPersonalizedHead(Dictionary<string, T[]> fullParameters) |
Extracts the personalized head parameters (kept local). |
Dictionary<string, T[]> ExtractSharedParameters(Dictionary<string, T[]> fullParameters) |
Extracts the shared body + generic head (to be aggregated). |
T[] CombinePredictions(T[] genericPrediction, T[] personalizedPrediction) |
Combines generic and personalized predictions. |
T[] ComputeBalancedSoftmaxLogits(T[] logits, int[] classFrequencies) |
Computes the balanced softmax loss, which adjusts for class frequency imbalance. |