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/05/16 21:23:35 UTC

[GitHub] zhreshold commented on a change in pull request #10852: [MXNET-411] Add ROI Align

zhreshold commented on a change in pull request #10852: [MXNET-411] Add ROI Align
URL: https://github.com/apache/incubator-mxnet/pull/10852#discussion_r188777217
 
 

 ##########
 File path: tests/python/unittest/test_operator.py
 ##########
 @@ -6018,6 +6019,24 @@ def test_context_num_gpus():
         if str(e).find("CUDA") == -1:
             raise e
 
+    
+@with_seed()
+def test_op_roi_align():
+    ctx=default_context()
+    data = mx.symbol.Variable(name='data')
+    rois = mx.symbol.Variable(name='rois')
+    test = mx.symbol.contrib.ROIAlign(data=data, rois=rois, pooled_size=(4, 4), spatial_scale=1)
+
+    x1 = np.random.rand(4, 1, 12, 12).astype('float64')
+    x2 = np.array([[0, 1.1, 1.1, 6.2, 6.2], [2, 6.1, 2.1, 8.2, 11.2], [1, 3.1, 1.1, 5.2, 10.2]], dtype='float64')
+
+    check_numeric_gradient(sym=test, location=[x1, x2],
+                           grad_nodes={'data':'write', 'rois':'null'},
+                           numeric_eps=1e-4, rtol=1e-1, atol=1e-4)
+    check_numeric_gradient(sym=test, location=[x1, x2],
+                           grad_nodes={'data':'add', 'rois':'null'},
+                           numeric_eps=1e-4, rtol=1e-1, atol=1E-4)
+
 
 Review comment:
   need a forward result check in addition to gradient check

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