Probability distributions - torch.distributions
The "distributions" package contains parameterizable probability
distributions and sampling functions. This allows the construction of
stochastic computation graphs and stochastic gradient estimators for
optimization. This package generally follows the design of the
TensorFlow Distributions package.
It is not possible to directly backpropagate through random samples.
However, there are two main methods for creating surrogate functions
that can be backpropagated through. These are the score function
estimator/likelihood ratio estimator/REINFORCE and the pathwise
derivative estimator. REINFORCE is commonly seen as the basis for
policy gradient methods in reinforcement learning, and the pathwise
derivative estimator is commonly seen in the reparameterization trick
in variational autoencoders. Whilst the score function only requires
the value of samples f(x), the pathwise derivative requires the