p2pfl.learning.frameworks.tensorflow.keras_dataset moduleΒΆ
Keras dataset export strategy.
- class p2pfl.learning.frameworks.tensorflow.keras_dataset.KerasExportStrategy[source]ΒΆ
Bases:
DataExportStrategy
Export strategy for TensorFlow/Keras datasets.
- static export(data, batch_size=None, columns=None, label_cols=None, **kwargs)[source]ΒΆ
Export the data as a TensorFlow Dataset.
- Parameters:
data (
Dataset
) β The Hugging Face Dataset to export. Transforms should already be applied to the dataset via set_transform.batch_size (
Optional
[int
]) β The batch size for the TensorFlow Dataset.seed β The seed for the TensorFlow Dataset.
columns (
Optional
[List
[str
]]) β The columns to include in the TensorFlow Dataset.label_cols (
Optional
[List
[str
]]) β The columns to use as labels.**kwargs β Additional keyword arguments.
- Return type:
DatasetV2
- Returns:
A TensorFlow Dataset.