vaseline555 / Federated-Learning-in-PyTorch

Handy PyTorch implementation of Federated Learning (for your painless research)
MIT License
409 stars 90 forks source link

when num_clients =1000, shards_per_clients=0, and there is a ValueError! #1

Closed DominicccLUO closed 2 years ago

vaseline555 commented 2 years ago

Happy new year! Thanks for your interest on my implementatin. TL; DR: it should not be set to zero.

As stated in (McMahan et al., 2017; https://arxiv.org/abs/1602.05629), you should at first need to understand the role of a 'shard'. Please read it first, and then you may understand why you should set shards_per_clients as a positive number in order to simulate non-IID data split scenario.

I'll make it throw an appropriate error when users set argument related to the shard as inappropriate number. Thank you.