You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by zh...@apache.org on 2018/01/31 17:09:18 UTC

[incubator-mxnet] branch master updated: sgld bugfix (#9641)

This is an automated email from the ASF dual-hosted git repository.

zhasheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git


The following commit(s) were added to refs/heads/master by this push:
     new 60ae6d4  sgld bugfix (#9641)
60ae6d4 is described below

commit 60ae6d4445fe3ca3f3686074863f1b0e4c4b3278
Author: dongzhuoyao <do...@users.noreply.github.com>
AuthorDate: Thu Feb 1 01:09:12 2018 +0800

    sgld bugfix (#9641)
---
 python/mxnet/optimizer.py | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/python/mxnet/optimizer.py b/python/mxnet/optimizer.py
index c3338f4..d3eeba1 100644
--- a/python/mxnet/optimizer.py
+++ b/python/mxnet/optimizer.py
@@ -952,8 +952,9 @@ class SGLD(Optimizer):
         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

-- 
To stop receiving notification emails like this one, please contact
zhasheng@apache.org.