autoencode | R Documentation |
Trains an autoencoder adapted to the data and extracts its encoding for the same data matrix.
autoencode(data, dim, type = "basic", activation = "linear", epochs = 20)
data |
Numeric matrix to be encoded |
dim |
Number of variables to be used in the encoding |
type |
Type of autoencoder to use: |
activation |
Activation type to be used in the encoding layer. Some available
activations are |
epochs |
Number of times the data will traverse the autoencoder to update its weights |
Matrix containing the encodings
\link{autoencoder}
inputs <- as.matrix(iris[, 1:4]) 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") }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.