mxnet-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From GitBox <...@apache.org>
Subject [GitHub] haojin2 commented on a change in pull request #11229: [MXNET-379] L1 Normalization
Date Mon, 11 Jun 2018 19:50:47 GMT
haojin2 commented on a change in pull request #11229: [MXNET-379] L1 Normalization
URL: https://github.com/apache/incubator-mxnet/pull/11229#discussion_r194526139
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -2879,6 +2879,36 @@ def npy_layer_norm(data, gamma, beta, axis=1, eps=1E-5):
                                grad_nodes={'data': req, 'gamma': req, 'beta': req},
                                numeric_eps=1e-2, rtol=1e-2, atol=1e-2)
 
+@with_seed()
+def test_norml1():
+    def npy_l1norm(data, axis):
+        np.sum(abs(np_arr), axis=i, keepdims=True)
+    ctx = default_context()
+    data = mx.symbol.Variable('data')
+
+    for dtype in [np.float16, np.float32, np.float64]:
+        dtype = np.float32
+        in_data = np.random.uniform(-1, 1, (4,4,4,4)).astype(dtype)
 
 Review comment:
   Also, better randomize the number of dimensions of your input.

----------------------------------------------------------------
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

Mime
View raw message