Class - DataLoader#
- class openfl.federated.data.loader.DataLoader(**kwargs)[source]#
Bases:
objectA base class used to represent a Federated Learning Data Loader.
This class should be inherited by any data loader class specific to a machine learning framework.
- None#
- __init__(**kwargs)[source]#
Initializes the DataLoader object.
- Parameters:
kwargs – Additional arguments to pass to the function.
Methods
__init__(**kwargs)Initializes the DataLoader object.
Returns the shape of an example feature array.
Returns the data loader for inferencing data.
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]#
Returns the shape of an example feature array.
- Raises:
NotImplementedError – This method must be implemented by a child class.
- get_infer_loader()[source]#
Returns the data loader for inferencing data.
- Raises:
NotImplementedError – This method must be implemented by a child class.
- 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.