Learn R Programming

ruta (version 1.0.2)

autoencode: Automatically compute an encoding of a data matrix

Description

Trains an autoencoder adapted to the data and extracts its encoding for the same data matrix.

Usage

autoencode(data, dim, type = "basic", activation = "linear", epochs = 20)

Arguments

data

Numeric matrix to be encoded

dim

Number of variables to be used in the encoding

type

Type of autoencoder to use: "basic", "sparse", "contractive", "denoising", "robust" or "variational"

activation

Activation type to be used in the encoding layer. Some available activations are "tanh", "sigmoid", "relu", "elu" and "selu"

epochs

Number of times the data will traverse the autoencoder to update its weights

Value

Matrix containing the encodings

See Also

autoencoder

Examples

Run this code
# NOT RUN {
inputs <- as.matrix(iris[, 1:4])

# }
# NOT RUN {
# 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