FedRS
¶
Implementation of the [FedRS21] algorithm.
References
[FedRS21]
Xin-Chun Li and De-Chuan Zhan. FedRS: Federated Learning with Restricted Softmax for Label Distribution Non-IID Data. In KDD (2021). URL: https://doi.org/10.1145/3447548.3467254
Classes included in fluke.algorithms.fedrs
Restricted Softmax Loss function. |
|
Classes¶
- class fluke.algorithms.fedrs.RSLoss(class_scaling: Tensor, reduction: Literal['mean', 'sum'] = 'mean')[source]¶
Bases:
Module
Restricted Softmax Loss function.
- Parameters:
class_scaling (torch.Tensor) – Class scaling factor.
reduction (Literal["mean", "sum"]) – Specifies the reduction to apply to the output.
See also
This loss function is very similar to the one used in
FedLC
, i.e.,fluke.algorithms.fedlc.CalibratedLoss
.
- class fluke.algorithms.fedrs.FedRSClient(index: int, train_set: FastDataLoader, test_set: FastDataLoader, optimizer_cfg: OptimizerConfigurator, loss_fn: Module, local_epochs: int, alpha: float, count_as_missing: int = 2, fine_tuning_epochs: int = 0, **kwargs: dict[str, Any])[source]¶
Bases:
Client