Skip to content

Instantly share code, notes, and snippets.

@radi-cho
Created August 1, 2022 21:50
Show Gist options
  • Save radi-cho/058d410589f32595d6db21578d8c9bc3 to your computer and use it in GitHub Desktop.
Save radi-cho/058d410589f32595d6db21578d8c9bc3 to your computer and use it in GitHub Desktop.
temperature = 0.01
dist = tfp.distributions.RelaxedOneHotCategorical(temperature, probs=p)
dist.sample()
<tf.Tensor: shape=(3,), dtype=float32, numpy=array([0., 1., 0.], dtype=float32)>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment