inputs <- as.matrix(iris[, 1:4])
# \donttest{
if (interactive() && keras::is_keras_available()) {
# Train a basic autoencoder and generate a 2-variable encoding
encoded <- autoencode(inputs, 2)
# Train a contractive autoencoder with tanh activation
encoded <- autoencode(inputs, 2, type = "contractive", activation = "tanh")
}
# }
Run the code above in your browser using DataLab