Skip to content

about the implementation of FedAvg #20

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
haoyu0408 opened this issue May 23, 2021 · 3 comments
Open

about the implementation of FedAvg #20

haoyu0408 opened this issue May 23, 2021 · 3 comments

Comments

@haoyu0408
Copy link

Why does the FedAvg use a simple average without weight?

@Grassyue
Copy link

Grassyue commented Jul 6, 2021

Why does the FedAvg use a simple average without weight?

Hi, I have the same question with you.
Have you solve it ?

@GuoJingtao-1997
Copy link

I think maybe the num of samples (train + test) for each client are the same and therefore the weight for each client are the same. So we can directly average them. This is my viewpoint.

@haoyu0408
Copy link
Author

Why does the FedAvg use a simple average without weight?

Hi, I have the same question with you.
Have you solve it ?

For FedAvg, loss=p1L1+...+pkLk, where pi=ni/n, Li=li/ni. I think this implementation changes it as nloss=L1+...+Lk. And for this loss function, it can use this implementation. For loss=p1L1+...+pk*Lk, you need to divide ni for each loss function in local clients and then weighted sum their parameters.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants