Skip to contents

x_t = sqrt(alpha_bar_t) x_0 + sqrt(1 - alpha_bar_t) eps.

Usage

morie_geron_ddpm_forward_process(x0, t, alpha_bar, noise = NULL, seed = 0)

Arguments

x0

Numeric vector or matrix.

t

0-based index into alpha_bar.

alpha_bar

Non-increasing cumulative products in [0, 1].

noise

Optional noise of the same shape; otherwise LCG normals.

seed

LCG seed.

Value

List with x_t, noise, signal_coef, noise_coef, snr, alpha_bar_t.

Examples

x0 <- c(0.5, -0.3, 1.2)
alpha_bar <- cumprod(rep(0.98, 10))
morie_geron_ddpm_forward_process(x0, t = 5, alpha_bar = alpha_bar, seed = 1)
#> $x_t
#> [1] 0.07973384 0.13770934 1.01884379
#> 
#> $noise
#> [1] -1.1568344  1.2432717 -0.3273031
#> 
#> $signal_coef
#> [1] 0.941192
#> 
#> $noise_coef
#> [1] 0.3378722
#> 
#> $snr
#> [1] 7.759818
#> 
#> $alpha_bar_t
#> [1] 0.8858424
#> 
#> $t
#> [1] 5
#> 
#> $estimate
#> [1] 0.07973384 0.13770934 1.01884379
#> 
#> $n
#> [1] 3
#>