## 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)


-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/apache/incubator-mxnet/issues/19722

Reply via email to