Skip to contents

Formula: non-Markovian deterministic reverse

Usage

Ddimst(
  x_t,
  t,
  eps_theta,
  eta = 0,
  T = 1000,
  alpha_bar_t = NULL,
  alpha_bar_prev = NULL
)

Arguments

x_t

Current latent.

t

Current timestep, at least 1.

eps_theta

Predicted noise, same length as x_t.

eta

Stochasticity in [0, 1].

T

Total number of steps for the cosine schedule.

alpha_bar_t, alpha_bar_prev

Optional explicit cumulative alphas.

Value

List with estimate, x_prev, x0_pred, sigma, alpha_bar_t, alpha_bar_prev, n, method.

Details

x_{t-1} = sqrt(a_{t-1}) x0_hat + sqrt(1 - a_{t-1} - sigma^2) eps

  • sigma z, with x0_hat = (x_t - sqrt(1 - a_t) eps) / sqrt(a_t) and sigma = eta sqrt((1 - a_{t-1})/(1 - a_t)) sqrt(1 - a_t/a_{t-1}). At eta = 0 the update is fully deterministic (that is DDIM); at eta = 1 it reproduces the DDPM ancestral step. The noise z is taken as zero so the map is a function of its arguments alone.

References

Song, Meng & Ermon (2021), Denoising Diffusion Implicit Models, ICLR 2021.

Examples

Ddimst(x_t = c(1, 2, 3, 4, 5, 6, 7, 8), t = 5L, eps_theta = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $estimate
#> [1] 4.491
#> 
#> $x_prev
#> [1] 0.998 1.996 2.994 3.992 4.990 5.988 6.986 7.984
#> 
#> $x0_pred
#> [1] 0.9841576 1.9683152 2.9524728 3.9366304 4.9207881 5.9049457 6.8891033
#> [8] 7.8732609
#> 
#> $sigma
#> [1] 0
#> 
#> $alpha_bar_t
#> [1] 0.999745
#> 
#> $alpha_bar_prev
#> [1] 0.9998057
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "DDIM reverse step"
#> 
#> attr(,"class")
#> [1] "morie_rich_result" "list"