openfl.federated.data.loader.DataLoader

class openfl.federated.data.loader.DataLoader(**kwargs)

Bases: object

A 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.

Class Attributes:

None

Methods

get_feature_shape

Returns the shape of an example feature array.

get_infer_loader

Returns the data loader for inferencing data.

get_train_data_size

Returns the total number of training samples.

get_train_loader

Returns the data loader for the training data.

get_valid_data_size

Returns the total number of validation samples.

get_valid_loader

Returns the data loader for the validation data.

get_feature_shape()

Returns the shape of an example feature array.

Raises:

NotImplementedError – This method must be implemented by a child class.

get_infer_loader()

Returns the data loader for inferencing data.

Raises:

NotImplementedError – This method must be implemented by a child class.

get_train_data_size()

Returns the total number of training samples.

Raises:

NotImplementedError – This method must be implemented by a child class.

get_train_loader(**kwargs)

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.

get_valid_data_size()

Returns the total number of validation samples.

Raises:

NotImplementedError – This method must be implemented by a child class.

get_valid_loader()

Returns the data loader for the validation data.

Raises:

NotImplementedError – This method must be implemented by a child class.