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

A question about variable self.acc_sum in GHMC_loss #14

Open
sjtuliuqin opened this issue Mar 19, 2019 · 2 comments
Open

A question about variable self.acc_sum in GHMC_loss #14

sjtuliuqin opened this issue Mar 19, 2019 · 2 comments

Comments

@sjtuliuqin
Copy link

Hi, Buyu,
Thanks for your great work !
In line 22 of ghm_loss.py, the variable self.accu_sum in GHMC_loss class is initialized as a list filling with zeros. In line 47, you update it with the following code:
self.acc_sum[i] = mmt * self.acc_sum[i]
+ (1 - mmt) * num_in_bin
As self.acc_sum[i] is initialized as zero, mmt * self.acc_sum[i] has no meaning. Could you explain a little bit about your idea here?

Best Regards
Qin

@sjtuliuqin
Copy link
Author

I think I have understood your intention.
As the name 'acc_sum' indicates, you want to record the accumulated sum of all samples whose gradient lies within the bin. Thus, as batch iteration goes on, self.acc_sum would consider not only samples in the current batch, but also its previous value. The ratio is controlled by 'mmt'.
Thanks again !

@libuyu
Copy link
Owner

libuyu commented Mar 19, 2019

@sjtuliuqin Yes, you got it. And for the theory of the "acc_sum", you can refer to the part "EMA" on page 4 in our paper https://arxiv.org/pdf/1811.05181.pdf. Thank you for your interest.

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

2 participants