Skip to content

Commit e3f62ae

Browse files
authored
Merge pull request #955 from dfalbel/vae-examples
re-update the vae examples
2 parents 01a06a2 + 008fce8 commit e3f62ae

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

vignettes/examples/variational_autoencoder.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
#' This script demonstrates how to build a variational autoencoder with Keras.
22
#' Reference: "Auto-Encoding Variational Bayes" https://arxiv.org/abs/1312.6114
33

4+
# Note: This code reflects pre-TF2 idioms.
5+
# For an example of a TF2-style modularized VAE, see e.g.: https://github.com/rstudio/keras/blob/master/vignettes/examples/eager_cvae.R
6+
# Also cf. the tfprobability-style of coding VAEs: https://rstudio.github.io/tfprobability/
7+
8+
# With TF-2, you can still run this code due to the following line:
9+
if (tensorflow::tf$executing_eagerly())
10+
tensorflow::tf$compat$v1$disable_eager_execution()
11+
412
library(keras)
513
K <- keras::backend()
614

vignettes/examples/variational_autoencoder_deconv.R

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,14 @@
22
#' and deconvolution layers.
33
#' Reference: "Auto-Encoding Variational Bayes" https://arxiv.org/abs/1312.6114
44

5+
# Note: This code reflects pre-TF2 idioms.
6+
# For an example of a TF2-style modularized VAE, see e.g.: https://github.com/rstudio/keras/blob/master/vignettes/examples/eager_cvae.R
7+
# Also cf. the tfprobability-style of coding VAEs: https://rstudio.github.io/tfprobability/
8+
9+
# With TF-2, you can still run this code due to the following line:
10+
if (tensorflow::tf$executing_eagerly())
11+
tensorflow::tf$compat$v1$disable_eager_execution()
12+
513
library(keras)
614
K <- keras::backend()
715

0 commit comments

Comments
 (0)