fl4health.client_managers.fixed_sampling_client_manager module

class FixedSamplingClientManager[source]

Bases: SimpleClientManager

Keeps sampling fixed until it’s reset

__init__()[source]

Client manager that samples the same set of clients each time until it receives a signal to resample the clients to be selected. This class, for example, helps facilitate the requirements associated with FedDG-GA

reset_sample()[source]

Resets the saved sample so self.sample produces a new sample again.

Return type:

None

sample(num_clients, min_num_clients=None, criterion=None)[source]

Return a new client sample for the first time it runs. For subsequent runs, it will return the same sampling until self.reset_sampling() is called.

Parameters:
  • num_clients (int) – The number of clients to sample.

  • min_num_clients (int | None, optional) – The minimum number of clients to return in the sample. Defaults to None.

  • criterion (Criterion | None, optional) – A criterion to filter clients to sample. If None, no criterion is applied during selection/sampling. Defaults to None.

Returns:

A list of sampled clients as ClientProxy instances.

Return type:

list[ClientProxy]