Learn R Programming

dnn (version 0.0.6)

fwdNN: Feed forward and back propagation for dnn Models

Description

{fwdNN} is an R function for feed forward network.

Usage

fwdNN(X, model)             
#
# to calculate a feed feedward model 
#

Value

The function fwdNN return a list containing at least the following components:

cache

a list contains the values of each output layer after activation function transformation and adding the intercept term (i.e. the bias term). The intercept does not add to the output layer in the cache.

Arguments

X

For "dNNmodel", X is a design matrix of dimension n * p.

model

a model return from dNNmodel function.

Author

Bingshu E. Chen (bingshu.chen@queensu.ca)

Details

'cache' is the cache of each input layer, will be used in the bwdNN function.

See Also

bwdNN, plot.dNNmodel, print.dNNmodel, summary.dNNmodel,

Examples

Run this code
### define a dnn model, calculate the feed forward network
   model = dNNmodel(units = c(8, 6, 1), activation = c("elu", "sigmoid", "sigmoid"), 
                   input_shape = 3)
  
### feed forward with a dummy x matrix
   x = matrix(runif(15), nrow = 5, ncol = 3)
   cache = fwdNN(x, model)

Run the code above in your browser using DataLab