darch (version 0.12.0)

predict.DArch: Forward-propagate data.

Description

Forward-propagate given data through the deep neural network.

Usage

# S3 method for DArch
predict(object, ..., newdata = NULL, type = "raw",
  inputLayer = 1, outputLayer = 0)

Arguments

object

'>DArch instance

...

Further parameters, if newdata is NULL, the first unnamed parameter will be used for newdata instead.

newdata

New data to predict, NULL to return latest network output

type

Output type, one of: raw, bin, class, or character. raw returns the layer output, bin returns 1 for every layer output >0.5, 0 otherwise, and class returns 1 for the output unit with the highest activation, otherwise 0. Additionally, when using class, class labels are returned when available. character is the same as class, except using character vectors instead of factors.

inputLayer

Layer number (> 0). The data given in newdata will be fed into this layer. Note that absolute numbers count from the input layer, i.e. for a network with three layers, 1 would indicate the input layer.

outputLayer

Layer number (if > 0) or offset (if <= 0) relative to the last layer. The output of the given layer is returned. Note that absolute numbers count from the input layer, i.e. for a network with three layers, 1 would indicate the input layer.

Value

Vector or matrix of networks outputs, output type depending on the type parameter.

See Also

Other darch interface functions: darchBench, darchTest, darch, plot.DArch, print.DArch

Examples

Run this code
# NOT RUN {
data(iris)
model <- darch(Species ~ ., iris, retainData = T)
predict(model)
# }

Run the code above in your browser using DataLab