*This question was migrated from Github Discussions.
Original questions:
- Given a total of N clients, I want to randomly sample M (M < N) clients for each round of federated learning. So the set of M clients used in 2 consecutive rounds can be different. Is there a way to do that? Currently, I am using fraction_fit parameter of FedAvg but it doesn’t seem to sample clients randomly.
- Also, is it possible to sample different numbers of clients in each round of federated training? For example, we use 20 clients for the first round and 30 clients for the second round.
- Also, is there a way to disconnect clients in every round of training?
Answer:
“Hi, you can totally implement the sampling mechanism you describe. One way of doing it is by having a slightly customised strategy. In particular you want to look into the configure_fit()
method and add some logic to call client_manager.sample()
using your M by drawing for instance from a uniform distribution (e.g. with numpy.random.randint
)”