Let’s explore the beta distribution through the following steps:
- Import PyTorch and matplotlib because we will visualize the shape of the distributions:
>>> import torch>>> import matplotlib.pyplot as plt
- We start by visualizing the shape of the beta distribution with the starting positions, α=1 and β=1:
>>> beta1 = torch.distributions.beta.Beta(1, 1)>>> samples1 = [beta1.sample() for _ in range(100000)]>>> plt.hist(samples1, range=[0, 1], bins=10)>>> plt.title(‘beta(1, 1)’)>>> plt.show()
You will see the following plot:
Obviously, when α=1 and β=1, it doesn't provide any information about where the true value lies in the ...