sparse_autoenc: Train a sparse autoencoder.

Description Usage Arguments Value

View source: R/autoenc.R

Description

Implementation based on http://web.stanford.edu/class/archive/cs/cs294a/cs294a.1104/sparseAutoencoder.pdf

Usage

1
2
3
4
sparse_autoenc(X, num_hidden, activation, lambda, beta, rho, epsilon,
  tolerance = sqrt(.Machine$double.eps), X.test = NULL,
  d_activation = NULL, optim_method = "BFGS", max_iterations = 2000,
  rescale = TRUE, rescaling_offset = 0.001)

Arguments

X

matrix. Training dataset.

num_hidden

integer. Specifies number of neurons in each hidden layer.

activation

character or function. If it's a character it has to be one of the predefined activation functions. If it's a function, d_activation, activation prime, function must be supplied as well. Those functions are needed for backpropagation.

lambda

numeric. Weight decay parameter.

beta

numeric. Learning rate parameter for algorithm trying to (approximately) satisfy the sparsity constraint.

rho

numeric. Sparsity parameter, which specifies our desired level of sparsity.

epsilon

numeric. A (small) parameter for initialization of weight matrices as small gaussian random numbers sampled from N(0, epsilon^2)

tolerance

numeric (optional). Tolarance to be used for comparing floting point numbers. Default is .Machine$double.eps

X.test

matrix (optional). Testing dataset for evaluating the network.

d_activation

function (optional). This parameter will be omitted if activation is a character, otherwise this function will be used in backpropagation as activation prime, in which case this parameter becomes mandatory.

optim_method

character (optional). Optimization method to be used. Please check autoenc:::constants$optim_methods for available options. Default is "BFGS".

max_iterations

integer (optional). Maximum number of iterations for optimizer. Default is 2000.

rescale

logical or numeric. Autoencoders yield better results when used on normalized matrices. Normalization should be performed according to the activation function being used. Default is TRUE, which will select the appropritate ranges for activation functions included in the package. If you are providing custom activation function, you must specify an appropriate range, like c(-1, 1). If it is FALSE no rescaling will be performed.

rescaling_offest

numeric. A small value used in rescaling to c(rescale[1] + offset, rescale[2] - offset) interval. Default is 0.001.

Value

Object of class autoenc.


kirillseva/autoenc documentation built on May 20, 2019, 10:23 a.m.