access2rohit commented on issue #16178: [WIP]improving argmax perf
URL: https://github.com/apache/incubator-mxnet/pull/16178#issuecomment-533922434
 
 
   > @access2rohit: It seems that to pass following test from 
/work/mxnet/julia/test/unittest/ndarray.jl, lines1511-1531:
   > 
   > ```
   > function test_argmax()
   > . . .
   >   @info "NDArray::argmax"
   >    @info "NDArray::argmax::NaN"
   >   let
   >     A = [1.  5 3;
   >          NaN 2 6]
   >     x = NDArray(A)
   > 
   >     @test copy(argmax(x, dims = 1)) == [1 1 2]
   >     @test copy(argmax(x, dims = 2)) == reshape([2, 3], :, 1)
   >   end
   > end
   > ```
   > 
   > We have to skip `NaN`'s. As far as I understand, in that case the outputs 
of `nd.argmax` and `np.nanarmax` should be identical and we will non need 
`nd.nanargmax`. Is it correct?
   > 
   > BTW, what would be correct output of `nd.argmax` when all elements of 
vector will be `NaN`'s?
   > 
   > ```
   >     A = [1.  5 3;
   >          NaN NaN NaN]
   > ```
   
   @drivanov Yes Correct
   For all Nan along the axis we should ideally raise valueerror just like 
np.nanargmax: 
https://docs.scipy.org/doc/numpy/reference/generated/numpy.nanargmax.html

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


With regards,
Apache Git Services

Reply via email to