# NOT RUN {
library(purrr)
x <- as.matrix(iris[, 1:4])
# }
# NOT RUN {
# Save a trained model
saved_file <-
autoencoder(2) %>%
train(x) %>%
save_as("my_model.tar.gz", dir = tempdir())
# Load and use the model
encoded <- load_from(saved_file) %>% encode(x)
# }
Run the code above in your browser using DataLab