View source on GitHub |
Builds the function for sampling from the input iterator at each round.
tff.simulation.build_uniform_sampling_fn(
sample_range: Sequence[T],
replace: bool = False,
random_seed: Optional[int] = None
) -> Callable[[int, int], list[T]]
If an integer random_seed
is provided, 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.
Returns | |
---|---|
A function that takes as input an integer round_num and integer size and
returns a list of size elements sampled (pseudo-)randomly from the input
sample_range .
|