Skip to content

Instantly share code, notes, and snippets.

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