For probably unjustified reasons, I want to parameterise my torch.distributions objects using the natural parameters, which for a categorical are the log-probabilities.
I noticed that in the documentation, only the normalised probabilities (probs) and log-odds (logits) are supported, which seemed strange for a categorical. But on further inspection, it seems that the logits parameter actually refers to the log-probabilities, log p(x_i), not the log-odds, log p(x_i)/(1-p(x_i)). If it’s the case that logits actually refers to the (unnormalised) log-probabilities, maybe the documentation should be updated to avoid confusion.
I know this is a pretty small error, but I did spend a non-zero amount of time trying to work out a good way to make my catagorical.Categorical accept log-probabilities, in a way that avoids unnecessary exponentiations. Could save someone else a few minutes too!