CCVR

Implementation of the CCVR [CCVR21] algorithm.

References

[CCVR21]

Mi Luo, Fei Chen, Dapeng Hu, Yifan Zhang, Jian Liang, Jiashi Feng. No Fear of Heterogeneity: Classifier Calibration for Federated Learning with Non-IID Data. In NeurIPS (2021). URL: https://arxiv.org/abs/2106.05001

Classes included in fluke.algorithms.ccvr

Classes

class fluke.algorithms.ccvr.CCVRClient(index: int, train_set: FastDataLoader, test_set: FastDataLoader, optimizer_cfg: OptimizerConfigurator, loss_fn: Module, local_epochs: int = 3, **kwargs: dict[str, Any])[source]

Bases: Client

compute_mean_cov() None[source]

Computes the label-wise mean and covariance of the data. After the computation, the client send (through the channel) a message to the server containing the computed values and the number of examples per class.

class fluke.algorithms.ccvr.CCVRServer(model: Module, test_set: FastDataLoader, clients: Iterable[Client], weighted: bool = False, lr: float = 0.1, batch_size: int = 64, sample_per_class: int = 100, **kwargs: dict[str, Any])[source]

Bases: Server

finalize() None[source]

In the CCVR Server, at the end of the learning the model is calibrated according to the data distributions of the clients.

class fluke.algorithms.ccvr.CCVR(n_clients: int, data_splitter: DataSplitter, hyper_params: DDict)[source]

Bases: CentralizedFL