DeepNetworkTrain: Training a simple deep network.

Description Usage Arguments Examples

View source: R/DeepNetwork.R

Description

This will train a simple 'deep' neural network with two hidden layers. It will use an autoencoder for pretraining. For more information refer to the Shark tutorial at http://image.diku.dk/shark/sphinx_pages/build/html/rest_sources/tutorials/algorithms/deep_denoising_autoencoder_network.html

Usage

1
2
3
4
DeepNetworkTrain(x, y, nHidden1 = 8L, nHidden2 = 8L,
  unsupRegularisation = 0.001, noiseStrength = 0.3,
  unsupIterations = 100L, regularisation = 1e-04, iterations = 200L,
  verbose = FALSE)

Arguments

x

matrix with input data

y

vector with labels

nHidden1

number of nodes of first hidden layer (part of network model)

nHidden2

number of nodes of second hidden layer (part of network model)

unsupRegularisation

regularization factor of supervised training

noiseStrength

noise strength for unsupervised training

unsupIterations

iteration number for unsupervised training

regularisation

regularisation factor for supervised training

iterations

iteration number for supervised training

verbose

print extra information?

Examples

1
2
3
4
5
6
7
8
9
	x = as.matrix(iris[,1:4])
	y = as.vector(as.numeric(iris[,5]))
	y = replace(y, y == 2, 0)
	y = replace(y, y == 3, 0)
	model = DeepNetworkTrain (x, y, nHidden1 = 32, nHidden2 = 32)
	results = DeepNetworkPredict (x, model)
	networkPrediction = apply (results$prediction, 1, which.max) - 1
	errors = sum(abs(y - networkPrediction))/length(y)
	cat("Network produced ", errors, "errors.\n")

Example output

RcppShark v3.1.1 loaded.
Network produced  0 errors.

RcppShark documentation built on May 30, 2017, 6:20 a.m.