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

why override the default step() #11

Open
QasimWani opened this issue Aug 1, 2020 · 0 comments
Open

why override the default step() #11

QasimWani opened this issue Aug 1, 2020 · 0 comments

Comments

@QasimWani
Copy link

QasimWani commented Aug 1, 2020

baby-a3c/baby-a3c.py

Lines 72 to 78 in 85899d7

def step(self, closure=None):
for group in self.param_groups:
for p in group['params']:
if p.grad is None: continue
self.state[p]['shared_steps'] += 1
self.state[p]['step'] = self.state[p]['shared_steps'][0] - 1 # a "step += 1" comes later
super.step(closure)

Why did you override the default implementation of step(closure)? The default one calculates exponential moving average. Your implementation doesn't calculate the step count because it always returns None. I looked over torch's documentation for step() but couldn't understand exactly why you chose to overide the step function.
Kindly review the following PR: #9

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