Skip to content

Instantly share code, notes, and snippets.

@ericjang
Created January 17, 2018 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ericjang/8f4439ace240f355b686bafb780ffb26 to your computer and use it in GitHub Desktop.
Save ericjang/8f4439ace240f355b686bafb780ffb26 to your computer and use it in GitHub Desktop.
batch_size=512
x2_dist = tfd.Normal(loc=0., scale=4.)
x2_samples = x2_dist.sample(batch_size)
x1 = tfd.Normal(loc=.25 * tf.square(x2_samples),
scale=tf.ones(batch_size, dtype=tf.float32))
x1_samples = x1.sample()
x_samples = tf.stack([x1_samples, x2_samples], axis=1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment