adding test for softmax operator for inputs with large magnitude#13328
adding test for softmax operator for inputs with large magnitude#13328anirudh2290 merged 6 commits intoapache:masterfrom
Conversation
|
@mxnet-label-bot add [pr-awaiting-review] |
pengzhao-intel
left a comment
There was a problem hiding this comment.
It's better we can cover more corner cases in this PR :)
| check_fullyconnected_training(stype) | ||
|
|
||
| def test_softmax_with_large_negative_inputs(): | ||
| input_data = mx.nd.array([[[[-1e30,-1e30]]]]) |
There was a problem hiding this comment.
Could you build other corner cases to cover more, such as 1e-30 as input or other possible combinations?
There was a problem hiding this comment.
Added more corner cases: extremely large positive and negative inputs covered (also checked for max and min values of float32 inputs). Please suggest if you think there are more corner cases that should be added.
| exec1.forward()[0].wait_to_read() | ||
| ndarr = exec1.outputs[0][0][0][0] | ||
| nparr = ndarr.asnumpy() | ||
| assert np.array_equal(nparr, true_output) |
There was a problem hiding this comment.
can we use assert_almost_equal in test_utils.
There was a problem hiding this comment.
assert_almost_equal makes more sense as we are comparing floats here. Corrected.
Description
Adding test for mkldnn and non-mkldnn Softmax operator for inputs with extremely large magnitudes. This PR fixes #13141 .
Checklist
Essentials
Please feel free to remove inapplicable items for your PR.