Skip to content

Commit 16991d3

Browse files
author
Sigrid Keydana
authored
Merge pull request #648 from rstudio/update_vae_example
for consistency, do reshape as in MNIST MLP example
2 parents a7646d8 + 2598f15 commit 16991d3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

vignettes/examples/variational_autoencoder.R

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ vae %>% compile(optimizer = "rmsprop", loss = vae_loss)
7070
mnist <- dataset_mnist()
7171
x_train <- mnist$train$x/255
7272
x_test <- mnist$test$x/255
73-
x_train <- x_train %>% apply(1, as.numeric) %>% t()
74-
x_test <- x_test %>% apply(1, as.numeric) %>% t()
73+
x_train <- array_reshape(x_train, c(nrow(x_train), 784), order = "F")
74+
x_test <- array_reshape(x_test, c(nrow(x_test), 784), order = "F")
7575

7676

7777
# Model training ----------------------------------------------------------

0 commit comments

Comments
 (0)