Create layer configuration list

layer(nodes, activation = NULL)

Arguments

nodes

Number of nodes

activation

Optional activation function vector defined as [function, function_derivative]

This parameter is required for all hidden and final layers.

Check out Activation enum for available functions.

Value

Layer configuration list.

Examples

input_layer <- layer(nodes = 4) hidden_layer <- layer( nodes = 6, activation = Activation$SIGMOID ) layer_with_custom_activation <- layer( nodes = 6, activation = c( function(input) { 1 / (1 + exp(-input)) }, function(input, output) { output * (1 - output) } ) )