Skip to content

Instantly share code, notes, and snippets.

@horoiwa
Created July 11, 2023 09:15
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 horoiwa/c9e839383bd4ef41301812bba8d7b8fa to your computer and use it in GitHub Desktop.
Save horoiwa/c9e839383bd4ef41301812bba8d7b8fa to your computer and use it in GitHub Desktop.
eps_t = self(x_t, t, states)
mu = (1.0 / tf.sqrt(1.0 - beta_t)) * (x_t - (beta_t / tf.sqrt(1.0 - alphas_cumprod_t)) * eps_t)
sigma = tf.sqrt(tf.reshape(tf.gather(self.variance, indices=t), (-1, 1)))
noise = tf.random.normal(shape=x_t.shape, mean=0., stddev=1.)
x_t_minus_1 = mu + sigma * noise
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment