Learn R Programming

nnlib2Rcpp (version 0.1.8)

Autoencoder: Autoencoder NN

Description

A neural network for autoencoding data, projects data to a new set of variables.

Usage

Autoencoder(
  data_in,
  desired_new_dimension,
  number_of_training_epochs,
  learning_rate,
  num_hidden_layers = 1L,
  hidden_layer_size = 5L,
  show_nn = FALSE)

Arguments

data_in

data to be autoencoded, a numeric matrix, (2d, cases in rows, variables in columns). It is recommended to be in [0 1] range.

desired_new_dimension

number of new variables to be produced (effectively the size of the special hidden layer that outputs the new variable values, thus the dimension of the output vector space).

number_of_training_epochs

number of training epochs, aka presentations of all training data to ANN during training.

learning_rate

the learning rate parameter of the Back-Propagation (BP) NN.

num_hidden_layers

number of hidden layers on each side of the special layer.

hidden_layer_size

number of nodes (Processing Elements or PEs) in each hidden layer

show_nn

boolean, option to display the (trained) ANN internal structure.

Value

Returns a numeric matrix containing the projected data.

References

Nikolaidis V.N., Makris I.A, Stavroyiannis S, "ANS-based preprocessing of company performance indicators." Global Business and Economics Review 15.1 (2013): 49-58.

See Also

BP.

Examples

Run this code
# NOT RUN {
iris_s <- as.matrix(scale(iris[1:4]))
output_dim <- 2
epochs <- 100
learning_rate <- 0.73
num_hidden_layers <-2
hidden_layer_size <- 5

out_data <-  Autoencoder( iris_s, output_dim,
                          epochs, learning_rate,
                          num_hidden_layers, hidden_layer_size, FALSE)

plot( out_data,pch=21,
      bg=c("red","green3","blue")[unclass(iris$Species)],
      main="Randomly autoencoded Iris data")
# }

Run the code above in your browser using DataLab