Federated Training

class src.federated_training.DatasetFromSubset(subset)

Helper to convert subsets to datasets since PySyft only works with the ladder

static subset_to_dataset(subset)

Method to turn the index tensor and original dataset in subsets into smaller datasets

Parameters

subset – Subset to transform

Returns

dataset

src.federated_training.create_federated_dataset(path='/home/docs/checkouts/readthedocs.org/user_builds/distributed-malaria-detection/checkouts/latest/src/../data/Classification', img_size=128, percentage_of_dataset=numpy.array, balance=numpy.array)

Helper function to create datasets that can be used for federated learning

Parameters
  • path – (str) path to folders containing images

  • img_size (int) – size of image - underlying assumption of square images

  • percentage_of_dataset (list) – list or numpy array with percentage of each split

  • balance (list) – list of lists containing the wanted probabilities of each class in the given datasets

Returns

split datasets - subsets

src.federated_training.imbalanced_distribution()

train a model with data federated over multiple workers :return: