rotated_mnist#

Module Contents#

RotatedMNIST

Rotate MNIST and partition them.

class RotatedMNIST(root, path, num)#

Bases: fedlab.contrib.dataset.basic_dataset.FedDataset

Rotate MNIST and partition them.

Parameters:
  • root (str) – Path to download raw dataset.

  • path (str) – Path to save partitioned subdataset.

  • num_clients (int) – Number of clients.

preprocess(thetas=[0, 90, 180, 270], download=True)#

Define the dataset partition process

get_dataset(id, type='train')#

Get dataset class

Parameters:
  • id (int) – Client ID for the partial dataset to achieve.

  • type (str, optional) – Type of dataset, can be chosen from ["train", "val", "test"]. Defaults as "train".

Raises:

NotImplementedError

get_data_loader(id, batch_size=None, type='train')#