5

For example, if I provide a probability array of [0.5, 0.5], both functions will sample the index [0,1] with equal probability?

iacob
  • 20,084
  • 6
  • 92
  • 119
Mzq
  • 1,796
  • 4
  • 30
  • 65

1 Answers1

4

Yes:

[torch.distributions.categorical.Categorical()] is equivalent to the distribution that torch.multinomial() samples from.

ytsaig
  • 3,267
  • 3
  • 23
  • 27
iacob
  • 20,084
  • 6
  • 92
  • 119