new_dnn: Creats a new instance of darch class

Description Usage Arguments Examples

Description

This function creates a new instance of darch class

Usage

1
2
3
4
new_dnn(layer_structure, layer_functions = NULL,
  output_layer_default = linearUnitDerivative,
  hidden_layer_default = rectified_linear_unit_function,
  weight_initiliazaiton = generateWeights)

Arguments

layer_structure

a int vector that specifies the number and width of layers

layer_functions

a list of activation functions used by each layer

output_layer_default

the activation function for the output layer

hidden_layer_default

the activation function for the hidden layers

weight_initiliazaiton

function that initialize a layer's weight matrix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# create a new deep neural network for classificaiton
dnn_regression <- new_dnn(
 c(2, 50, 50, 20, 1),
 # The layer structure of the deep neural network.
 # The first element is the number of input variables.
 # The last element is the number of output variables.
 hidden_layer_default = rectified_linear_unit_function,
 # for hidden layers, use rectified_linear_unit_function
 output_layer_default = sigmoidUnitDerivative
 # for classification, use sigmoidUnitDerivative function
)

# create a new deep neural network for classificaiton
dnn_regression <- new_dnn(
 c(2, 50, 50, 20, 1),
 # The layer structure of the deep neural network.
 # The first element is the number of input variables.
 # The last element is the number of output variables.
 hidden_layer_default = rectified_linear_unit_function,
 # for hidden layers, use rectified_linear_unit_function
 output_layer_default = linearUnitDerivative
 # for regression, use linearUnitDerivative function
)

deeplearning documentation built on Jan. 15, 2017, 9:52 a.m.