Skip to contents

Each reverse step is delegated to morie_geron_ddim_sampling_step; this wrapper picks the n_steps evenly-spaced timesteps out of T.

Usage

morie_geron_ddim(
  x_T,
  model,
  T,
  n_steps,
  beta_schedule = "linear",
  clip_x0 = NULL
)

Arguments

x_T

Starting noise.

model

function(x_t, t) -> eps.

T

Training schedule length.

n_steps

Reverse steps taken.

beta_schedule

"linear"/"cosine"/vector.

clip_x0

c(lo, hi).

Value

List with x_0, trajectory, timesteps, model_calls, speedup.

Examples

zero <- function(x, t) rep(0, length(x))
morie_geron_ddim(1, zero, T = 4, n_steps = 2, beta_schedule = rep(0.5,
    4))
#> $x_0
#> [1] 4
#> 
#> $trajectory
#> $trajectory[[1]]
#> [1] 1
#> 
#> $trajectory[[2]]
#> [1] 2.828427
#> 
#> $trajectory[[3]]
#> [1] 4
#> 
#> 
#> $timesteps
#> [1] 4 1
#> 
#> $x0_preds
#> $x0_preds[[1]]
#> [1] 4
#> 
#> $x0_preds[[2]]
#> [1] 4
#> 
#> 
#> $model_calls
#> [1] 2
#> 
#> $speedup
#> [1] 2
#> 
#> $alpha_bar
#> [1] 1.0000 0.5000 0.2500 0.1250 0.0625
#> 
#> $T
#> [1] 4
#> 
#> $n_steps
#> [1] 2
#> 
#> $estimate
#> [1] 4
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "DDIM sub-sequence sampling; each step delegated to grddim"
#>