Skip to contents

Uses the shared morie_beta_schedule_values/morie_lcg_normal (hmdfw) so forward and reverse schedules cannot drift apart.

Usage

morie_geron_diffusion_reverse(
  x_T,
  model,
  T,
  beta_schedule = "linear",
  seed = 0,
  clip_x0 = NULL
)

Arguments

x_T

Starting noise.

model

function(x_t, t) -> eps, t is 1-based.

T

Steps (>=1).

beta_schedule

"linear"/"cosine"/vector.

seed

LCG seed.

clip_x0

Optional c(lo, hi).

Value

List with x_0, trajectory, means, betas, alpha_bar, model_calls.

Examples

zero <- function(x, t) rep(0, length(x))
morie_geron_diffusion_reverse(1, zero, T = 1, beta_schedule = 0.75)
#> $x_0
#> [1] 2
#> 
#> $trajectory
#> $trajectory[[1]]
#> [1] 1
#> 
#> $trajectory[[2]]
#> [1] 2
#> 
#> 
#> $means
#> $means[[1]]
#> [1] 2
#> 
#> 
#> $betas
#> [1] 0.75
#> 
#> $alphas
#> [1] 0.25
#> 
#> $alpha_bar
#> [1] 0.25
#> 
#> $n_steps
#> [1] 1
#> 
#> $model_calls
#> [1] 1
#> 
#> $estimate
#> [1] 2
#> 
#> $n
#> [1] 1
#> 
#> $method
#> [1] "ancestral DDPM reverse sampling with an enforced model(x_t, t) -> eps contract"
#>