dNNmodel {dnn} | R Documentation |
Specify a deep neural network model
Description
{dNNmodel} is an R function to create a deep neural network model that is to be used in the feed forward network { fwdNN } and back propagation { bwdNN }.
Usage
dNNmodel(units, activation=NULL, input_shape = NULL, type = NULL,
N = NULL, Rcpp=TRUE, optimizer = c("momentum", "nag", "adam"))
Arguments
units |
number of nodes for each layer |
activation |
activation function |
input_shape |
the number of columns of input X, default is NULL. |
N |
the number of training sample, default is NULL. |
type |
default is "dense", currently only support dense layer. |
Rcpp |
use Rcpp (C++ for R) to speed up the fwdNN and bwdNN, default is "TRUE". |
optimizer |
optimizer used in SGD, default is "momentum". |
Details
dNNmodel returns an object of class "dNNmodel".
The function "print" (i.e., "print.dNNmodel") can be used to print a summary of the dnn model,
The function "summary" (i.e., "summary.dNNmodel") can be used to print a summary of the dnn model,
Value
An object of class "dNNmodel" is a list containing at least the following components:
units |
number of nodes for each layer |
activation |
activation function |
drvfun |
derivative of the activation function |
params |
the initial values of the parameters, to be updated in model training. |
input_shape |
the number of columns of input X, default is NULL. |
N |
the number of training sample, default is NULL. |
type |
default is "dense", currently only support dense layer. |
Author(s)
Bingshu E. Chen (bingshu.chen@queensu.ca)
See Also
plot.dNNmodel
,
print.dNNmodel
,
summary.dNNmodel
,
fwdNN
,
bwdNN
,
optimizerSGD
,
optimizerNAG
,
Examples
### To define a dnn model
model = dNNmodel(units = c(8, 6, 1), activation = c("relu", "sigmoid", "sigmoid"),
input_shape = c(3))