litian96 / FedProx

Federated Optimization in Heterogeneous Networks (MLSys '20)
MIT License
642 stars 157 forks source link

Whether the difference calculation need to consider the proportion of the sample #12

Closed guobbin closed 4 years ago

guobbin commented 4 years ago

Dear Tian: Thank you very much for your code, I have a question: Whether the difference calculation need to consider the proportion of data rather than simply adding? 44~45, https://github.com/litian96/FedProx/blob/master/flearn/trainers/fedprox.py Thank you.

litian96 commented 4 years ago

Yes, you can do that. We didn't do that for simplicity and we found that the two choices yield similar results---large gradient variance tends to correspond to worse convergence.

Please let me know if you have other questions!