Skip to content

Commit

Permalink
sgld bugfix (apache#9641)
Browse files Browse the repository at this point in the history
  • Loading branch information
dongzhuoyao authored and szha committed Jan 31, 2018
1 parent d161818 commit 60ae6d4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions python/mxnet/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -952,8 +952,9 @@ def update(self, index, weight, grad, state):
grad = grad * self.rescale_grad
if self.clip_gradient is not None:
grad = clip(grad, -self.clip_gradient, self.clip_gradient)
weight[:] += - lr/2 * (grad + wd * weight) + normal(0, math.sqrt(lr),
weight.shape, weight.context)
weight[:] += - lr/2 * (grad + wd * weight) + normal(0, math.sqrt(lr), shape=weight.shape,
dtype=weight.dtype, ctx=weight.context)



@register # pylint: disable=invalid-name
Expand Down

0 comments on commit 60ae6d4

Please sign in to comment.