apache / mxnet

Lightweight, Portable, Flexible Distributed/Mobile Deep Learning with Dynamic, Mutation-aware Dataflow Dep Scheduler; for Python, R, Julia, Scala, Go, Javascript and more
https://mxnet.apache.org
Apache License 2.0
20.78k stars 6.79k forks source link

[R] sample.multinomial not working #7247

Open jeremiedb opened 7 years ago

jeremiedb commented 7 years ago

Usage of mx.nd.multinomial in R-package seems broken. A numeric value is returned rather than the expected integer. Maybe it has to do with the int32 format returned by the operator?

probs <- c(0, 0.1, 0.2, 0.3, 0.4)
probs <- cbind(probs, rev(probs))
probs <- mx.nd.array(probs)
mx.nd.sample.multinomial(data = probs, shape=1, get_prob = F)

             [,1] [,2]
[1,] 2.802597e-45    0
anirudhacharya commented 6 years ago

@sandeep-krishnamurthy please label - "Bug"

kalyc commented 6 years ago

Thanks for submitting the issue We are tracking this in our backlog when we pick up work on R implementation

@mxnet-label-bot add [Feature Request]

kalyc commented 6 years ago

@mxnet-label-bot add [Feature Request]