Skip to content
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

About FedAdagrad #2

Open
liyipeng00 opened this issue Jul 1, 2023 · 1 comment
Open

About FedAdagrad #2

liyipeng00 opened this issue Jul 1, 2023 · 1 comment

Comments

@liyipeng00
Copy link

Thanks for your solid and insigntful paper.

Lines 377-381 in main.py.

if(alg=='fedadagrad'):
    delta = delta + grad_avg**2
    grad_avg = grad_avg/(torch.sqrt(delta+epsilon_fedadagrad))

Yet, the pseudocode of original paper "Adaptive Federated Optimization" is
$x_{t+1} = x_{t} + \eta_g \frac{m_t}{\sqrt{v_t}+\tau}$

So maybe torch.sqrt(delta+epsilon_fedadagrad) should be tuned into torch.sqrt(delta)+epsilon_fedadagrad

Since I am not familiar with adagrad algorithm, I am not sure about it. Can you help me with this issue kindly?

@liyipeng00
Copy link
Author

liyipeng00 commented Jul 1, 2023

And about for lines 391-392.

grad_avg_normalized = grad_avg/(0.1)
delta_normalized = delta/(0.01)

From the original paper, we do not find that we need to normalize the grad.

If we use the bias-corrected estimate in adam "Adam A method for stochastic optimization", it should be
$m_t = m_t / (1-\beta_1^t)$
$v_t = v_t / (1-\beta_2^t)$
When $t>1$, $1-\beta_1^t \neq 0.1$ (only when t=1, left=right).

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

1 participant