fl4health.clients.fedper_client module

class FedPerClient(data_path, metrics, device, loss_meter_type=LossMeterType.AVERAGE, checkpoint_and_state_module=None, reporters=None, progress_bar=False, client_name=None)[source]

Bases: BasicClient

Client to implement the FedPer method (https://arxiv.org/abs/1912.00818). Trains a global feature extractor shared by all clients through FedAvg and a private classifier that is unique to each client. The training is nearly identical to the BasicClient with the exception that our parameter exchanger needs to be a fixed layer exchanger that only exchanges the feature extraction base, which relies on the model being of type SequentiallySplitExchangeBaseModel.

get_parameter_exchanger(config)[source]

Returns Full Parameter Exchangers. Subclasses that require custom Parameter Exchangers can override this.

Parameters:

config (Config) – The config from server.

Returns:

Used to exchange parameters between server and client.

Return type:

ParameterExchanger