You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by GitBox <gi...@apache.org> on 2018/03/28 02:36:16 UTC

[GitHub] asitstands commented on a change in pull request #10260: [MXNET-145] Remove the dependences of mx.io and mx.initializer on the numpy's global random number generator

asitstands commented on a change in pull request #10260: [MXNET-145] Remove the dependences of mx.io and mx.initializer on the numpy's global random number generator
URL: https://github.com/apache/incubator-mxnet/pull/10260#discussion_r177625047
 
 

 ##########
 File path: python/mxnet/initializer.py
 ##########
 @@ -530,9 +530,9 @@ def _init_weight(self, _, arr):
         nout = arr.shape[0]
         nin = np.prod(arr.shape[1:])
         if self.rand_type == "uniform":
-            tmp = np.random.uniform(-1.0, 1.0, (nout, nin))
+            tmp = random.uniform(-1.0, 1.0, shape=(nout, nin)).asnumpy()
 
 Review comment:
   Numpy's SVD is applied to `tmp` array, so the conversions are needed. Currently mxnet seems not have SVD. There is a simple workaround to perform SVD using eigen decomposition (so using `syevd`), however it is not so efficient.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services