Class - FlowerDataLoader#
- class openfl.federated.data.loader_flower.FlowerDataLoader(data_path, **kwargs)[source]#
Bases:
DataLoaderFlower Dataloader
This class extends the OpenFL DataLoader to provide functionality for loading and partitioning data for a Flower workload.
- __init__(data_path, **kwargs)[source]#
Initialize the FlowerDataLoader.
- Parameters:
data_path (str or int) – The directory of the dataset.
**kwargs – Additional keyword arguments to pass to the parent DataLoader class.
- Raises:
FileNotFoundError – If the specified data path does not exist.
Methods
__init__(data_path, **kwargs)Initialize the FlowerDataLoader.
Override the parent method to return None.
Returns the data loader for inferencing data.
Get the configuration for each node.
Returns the total number of training samples.
get_train_loader(**kwargs)Returns the data loader for the training data.
Returns the total number of validation samples.
Returns the data loader for the validation data.
- get_feature_shape()[source]#
Override the parent method to return None. Flower’s own infrastructure will handle the feature shape.
- get_infer_loader()[source]#
Returns the data loader for inferencing data.
- Raises:
NotImplementedError – This method must be implemented by a child class.
- get_node_configs()[source]#
Get the configuration for each node.
This method returns the number of partitions and the data shard, which can be used by each node to access the dataset.
- Returns:
data path
- Return type:
str
- get_train_data_size()[source]#
Returns the total number of training samples.
- Raises:
NotImplementedError – This method must be implemented by a child class.
- get_train_loader(**kwargs)[source]#
Returns the data loader for the training data.
- Parameters:
kwargs – Additional arguments to pass to the function.
- Raises:
NotImplementedError – This method must be implemented by a child class.