Why the method of log_prob in my Pytorch doesn't work
For example, I have a Beta distribution in Pytorch, and the parameter a=0.01 and b=1.4709.
The density function is as below:
Density function of the Beta distribution
Then I sample an action from this distribution which is 1.1754943508222875e-38.
Now, there is something happened, after I calculate the log_prob of this action, what I get is 81.83833312988281.
We know that the sampled action is extremely small and the probability of this action should be very close to 1. However, the log_prob becomes very large and more than 0.
Firstly, shouldn't the log_prob be between [-inf, 0] ??

log_prob returns the log of the probability density/mass function (pdf) evaluated at the given sample value. Probability density mass is not the same as probability since for a continuous distribution like the Beta distribution  the probability of any single value is actually 0. As such, there's no stipulation that the log-pdf evaluated at a given point should be between [-inf,0].
In fact, for your linked example you can see that the pdf evaluated at  1.1754943508222875e-38 would be extremely large - hence the large positive log_prob value of 81.83833312988281.
