Skip to contents

Diffusion forward process: chain and closed form, cross-checked (hmdfw)

Usage

morie_geron_diffusion_forward(
  x0,
  T,
  beta_schedule = "linear",
  t = NULL,
  seed = 0
)

Arguments

x0

Clean sample.

T

Diffusion steps (>=1).

beta_schedule

"linear"/"cosine"/vector.

t

Step to report (default T).

seed

LCG seed.

Value

List with x_t, x_chain, betas, alphas, alpha_bar, signal_scale, noise_scale, noise, snr, variance_check.

Examples

morie_geron_diffusion_forward(x0 = c(1, 2, 3, 4, 5, 6, 7, 8), T = 5L)
#> $x_t
#> [1] 0.7869352 2.3756323 2.9744017 3.8121680 4.8077044 5.3040242 6.9132191
#> [8] 7.9596339
#> 
#> $x_chain
#> $x_chain[[1]]
#> [1] 1 2 3 4 5 6 7 8
#> 
#> $x_chain[[2]]
#> [1] 0.9883817 2.0123327 2.9965770 3.9885649 4.9830783 6.0175616 6.9929464
#> [8] 7.9971298
#> 
#> $x_chain[[3]]
#> [1] 0.8687623 2.0373082 2.9823474 3.8485508 5.0134627 6.0413069 6.8504158
#> [8] 7.9987140
#> 
#> $x_chain[[4]]
#> [1] 0.7028803 1.9738067 2.9767377 3.7779167 5.0799572 5.9067228 6.7431023
#> [8] 8.0198163
#> 
#> $x_chain[[5]]
#> [1] 0.5665128 1.7976586 3.0075556 3.6282909 4.8136413 5.6670689 6.5965360
#> [8] 8.2270628
#> 
#> $x_chain[[6]]
#> [1] 0.5339045 1.5414862 3.1206773 3.4020185 4.6914374 5.6989384 6.5606633
#> [8] 8.3083503
#> 
#> 
#> $betas
#> [1] 0.000100 0.005075 0.010050 0.015025 0.020000
#> 
#> $alphas
#> [1] 0.999900 0.994925 0.989950 0.984975 0.980000
#> 
#> $alpha_bar
#> [1] 0.9999000 0.9948255 0.9848275 0.9700305 0.9506299
#> 
#> $alpha_bar_t
#> [1] 0.9506299
#> 
#> $signal_scale
#> [1] 0.9750025
#> 
#> $noise_scale
#> [1] 0.2221939
#> 
#> $noise
#> [1] -0.8464107  1.9155669  0.2223021 -0.3953393 -0.3029251 -2.4572718  0.3969578
#> [8]  0.7183541
#> 
#> $snr
#> [1] 19.25516
#> 
#> $variance_check
#> $variance_check$chain_mse_from_signal
#> [1] 0.129068
#> 
#> $variance_check$closed_form_variance
#> [1] 0.04937013
#> 
#> 
#> $t
#> [1] 5
#> 
#> $T
#> [1] 5
#> 
#> $estimate
#> [1] 0.9750025
#> 
#> $n
#> [1] 8
#> 
#> $method
#> [1] "forward diffusion, chain and closed form, deterministic LCG/Box-Muller noise"
#>