Serialize a federated dataset into a SQL database compatible with SqlClientData
.
tff.simulation.datasets.save_to_sql_client_data(
client_ids: list[str],
dataset_fn: Callable[[str], tf.data.Dataset],
database_filepath: str,
allow_overwrite: bool = False,
split_names_by_client_id: Optional[Mapping[str, str]] = None
) -> None
Args | |
---|---|
client_ids
|
A list of string identifiers for clients in this dataset. |
dataset_fn
|
A callable that accepts a str as an argument and returns a
tf.data.Dataset instance. Unlike from_client_and_tf_dataset_fn , it
does not require a TF serializable dataset function.
|
database_filepath
|
A str filepath to the SQL database.
|
allow_overwrite
|
A boolean indicating whether to allow overwriting if file already exists at dataset_filepath. |
split_names_by_client_id
|
An optional mapping from client identifier to a
str identifier for the split (e.g. "train" ) the client belongs to.
|