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 the negative buffer #2

Closed
avis-ma opened this issue Mar 15, 2021 · 2 comments
Closed

A question about the negative buffer #2

avis-ma opened this issue Mar 15, 2021 · 2 comments

Comments

@avis-ma
Copy link

avis-ma commented Mar 15, 2021

Hi, I have a question about the buffer in class Adversary_Negatives. When initializing, the class registered two buffers, W and v. I know the W means the memory bank like MoCo, but what buffer v means. I can't understand very clearly. Kindly hope you can help me understand. Thank you very much.

@avis-ma avis-ma changed the title A question about the negetive buffer A question about the negative buffer Mar 15, 2021
@wang3702
Copy link
Collaborator

Please check https://pytorch.org/docs/stable/_modules/torch/optim/sgd.html#SGD. The v here is a mimic of the SGD momentum update to keep record of previous gradients to make the gradient update to be consistent.

v_{t+1} & = \mu * v_{t} + \text{lr} * g_{t+1},
p_{t+1} & = p_{t} - v_{t+1}.

we also further consider weight decay here.

@avis-ma
Copy link
Author

avis-ma commented Mar 16, 2021

Wow, I see. Thank you very much for your kindly reply.

@avis-ma avis-ma closed this as completed Mar 16, 2021
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