L = E_q[log p(x|z)] - beta D_KL(q||p) with D_KL = 0.5 sum_j (mu_j^2 + sigma_j^2 - 1 - log sigma_j^2); the capacity variant uses gamma |D_KL - C| in place of beta D_KL.
References
Higgins et al. (2017), ICLR; capacity form from Burgess et al. (2018), arXiv:1804.03599; Gaussian KL from Kingma and Welling (2014), Appendix B. Standard published form.
Examples
Betavae(x = c(1, 2, 3, 4, 5, 6, 7, 8), xhat = c(1, 2, 3, 4, 5, 6, 7, 8),
mu = c(1, 2, 3, 4, 5, 6, 7, 8), logvar = c(1, 2, 3, 4, 5, 6, 7, 8))
#> $objective
#> [1] -9755.8
#>
#> $recon
#> [1] -7.351508
#>
#> $kl
#> [1] 2437.112
#>
#> $klper
#> [1] 0.8591409 4.1945280 12.5427685 32.7990750 83.7065796
#> [6] 216.2143967 568.8165792 1517.9789935
#>
#> $penalty
#> [1] 9748.448
#>
#> $beta
#> [1] 4
#>
#> $J
#> [1] 8
#>
#> $d
#> [1] 8
#>
#> $method
#> [1] "beta-VAE objective (Higgins et al. 2017)"
#>
#> attr(,"class")
#> [1] "morie_rich_result" "list"
