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/06/23 01:33:42 UTC
[GitHub] anirudh2290 commented on issue #8288: test_svmoutput_with_type
fails in CI builds
anirudh2290 commented on issue #8288: test_svmoutput_with_type fails in CI builds
URL: https://github.com/apache/incubator-mxnet/issues/8288#issuecomment-399620847
Reproducible script :
```
import mxnet as mx
import numpy as np
def try_svm(dtype, x):
exe = sym.simple_bind(grad_req='write',**{'ctx': mx.cpu(0), 'svmoutput_data': (4, 2), 'type_dict': {'svmoutput_data': dtype} })
exe.arg_arrays[0][:] = x.astype(dtype)
exe.forward(is_train=True)
exe.backward(exe.outputs)
print(exe.arg_arrays[0].asnumpy())
print(exe.grad_arrays[0].asnumpy())
np.random.seed(1640822401)
x = np.random.normal(size=(4, 2), scale=1.0)
sym = mx.sym.SVMOutput(name='svmoutput', use_linear=True)
try_svm(np.float32, x)
try_svm(np.float16, x)
```
You will find that the two grad_arrays are different.
----------------------------------------------------------------
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