tff.program.DatasetDataSourceIterator

A tff.program.FederatedDataSourceIterator backed by tf.data.Datasets.

Inherits From: FederatedDataSourceIterator

A tff.program.FederatedDataSourceIterator backed by a sequence of tf.data.Dataset's, onetf.data.Dataset' per client, and selects data uniformly random with replacement.

datasets A sequence of tf.data.Dataset's to use to yield the data from this data source. </td> </tr><tr> <td>federated_type<a id="federated_type"></a> </td> <td> The type of the data returned by callingselect` on an iterator.

ValueError If datasets is empty or if each tf.data.Dataset in datasets does not have the same type specification.

federated_type The type of the data returned by calling select.

Methods

select

View source

Returns a new selection of data from this iterator.

Args
number_of_clients A number of clients to use when selecting data, must be a positive integer and less than the number of datasets.

Raises
ValueError If number_of_clients is not a positive integer or if number_of_clients is not less than the number of datasets.