dibgerge opened a new issue #19722:
URL: https://github.com/apache/incubator-mxnet/issues/19722


   ## Problem statement
   
   I am probably wrong about those, but I thought to ask here anyway. I was 
using `mxnet.gluon.probability.Categorical` from master, and two things came to 
my attention:
   
   1. It requires a `num_events` argument, which feel unnecessary, and possibly 
could be eliminated?
   2. [Possible bug] If providing `logit`, current `log_prob` implementation 
assumes we are providing `log softmax(x)`. Usually, when providing `logit`, it 
is the linear output of the net. This is the behavior also in torch/tensorflow, 
where internally, the logit is scaled by `logsumexp`.
   
   ## Proposed solutions
   1. Remove `num_events` argument
   2. If `logit` provided in constructor, shift it by `logsumexp`
   
   ## References
   - [Tensorflow 
implementation](https://github.com/tensorflow/probability/blob/v0.11.1/tensorflow_probability/python/distributions/categorical.py#L289)
   - [Torch 
implementation](https://github.com/pytorch/pytorch/blob/master/torch/distributions/categorical.py#L55)
   


----------------------------------------------------------------
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:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscr...@mxnet.apache.org
For additional commands, e-mail: issues-h...@mxnet.apache.org

Reply via email to