RSVP for your your local TensorFlow Everywhere event today!


Builds a function that (pseudo-)randomly samples clients.

The function uniformly samples a number of clients (without replacement within a given round, but with replacement across rounds) and returns their ids.

dataset A tff.simulation.ClientData object.
clients_per_round The number of client participants in each round.
random_seed If random_seed is set as an integer, then we use it as a random seed for which clients are sampled at each round. In this case, we set a random seed before sampling clients according to a multiplicative linear congruential generator (aka Lehmer generator, see 'The Art of Computer Programming, Vol. 3' by Donald Knuth for reference). This does not affect model initialization, shuffling, or other such aspects of the federated training process. Note that this will alter the global numpy random seed.

A function that takes as input an integer round_num and returns a a list of ids corresponding to the uniformly sampled clients.