SciRuby / nmatrix

Dense and sparse linear algebra library for Ruby via SciRuby
Other
469 stars 133 forks source link

Is there a 'argmax' method for NMatrix? #629

Closed weili-git closed 3 years ago

weili-git commented 4 years ago

By searching 'https://rdoc.info/github/SciRuby/nmatrix/NMatrix', I could only find 'max' method which returns the max value of certain dimension, but I need to get the index instead. Thank you so much if someone could help!

kojix2 commented 4 years ago

Use numo-narray... http://ruby-numo.github.io/numo-narray/yard/Numo/DFloat.html#argmax-instance_method http://ruby-numo.github.io/numo-narray/yard/Numo/DFloat.html#max_index-instance_method