Skip to content

Commit

Permalink
Fix printing momentum for non-deepspeed optimizer (microsoft#464)
Browse files Browse the repository at this point in the history
* Fix printing momentum for non-deepspeed optimizer

Fix printing momentum for non-deepspeed optimizer

* fix momentum access for Adam

fix momentum access for Adam
  • Loading branch information
Zixxy authored Oct 7, 2020
1 parent 2efea69 commit c39a76f
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion deepspeed/runtime/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -1002,7 +1002,10 @@ def get_type(self):
return self._get_optimizer_param('type')

def get_mom(self):
return self._get_optimizer_param('betas')
if self.optimizer_name() in ['SGD', 'RMSprop']:
return self._get_optimizer_param('momentum')
else:
return self._get_optimizer_param('betas')

def _report_progress(self, step):
lr = self.get_lr()
Expand Down

0 comments on commit c39a76f

Please sign in to comment.