Skip to content

Instantly share code, notes, and snippets.

@a-agmon
Created July 28, 2021 19:55
Show Gist options
  • Save a-agmon/45457f370c0d0ca8fb83e7f16c1784ef to your computer and use it in GitHub Desktop.
Save a-agmon/45457f370c0d0ca8fb83e7f16c1784ef to your computer and use it in GitHub Desktop.
def sample(args):
z_mean, z_log_var = args
batch = K.shape(z_mean)[0]
dim = K.int_shape(z_mean)[1]
epsilon = K.random_normal(shape=(batch, dim))
return z_mean + K.exp(0.5 * z_log_var) * epsilon
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment