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, transforms=None, batch_size=1, columns=None, label_cols=None, **kwargs)[source]ΒΆ

Export the data as a TensorFlow Dataset.

Parameters:
  • data (Dataset) – The Hugging Face Dataset to export.

  • transforms (Optional[Callable]) – Optional transformations to apply (not implemented yet).

  • batch_size (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.