Utility function to build a Keras MLP.
build_keras_net(
n_in,
n_out,
nodes = c(32L, 32L),
layer_pars = list(),
activation = "linear",
act_pars = list(),
dropout = 0.1,
batch_norm = TRUE,
batch_pars = list()
)
No return value.
(integer(1))
Number of input features.
(integer(1))
Number of targets.
(numeric())
Hidden nodes in network, each element in vector represents number
of hidden nodes in respective layer.
(list())
Arguments passed to keras::layer_dense.
(character(1))
Activation function passed to keras::layer_activation.
Default is linear.
(list())
Parameters for activation function, see
keras::layer_activation.
(numeric(1))
Optional dropout layer, if NULL
then no dropout layer added
otherwise either same dropout will be added to all layers.
(logical(1))
If TRUE
(default) then batch normalisation is applied
to all layers.
(list())
Parameters for batch normalisation, see
keras::layer_batch_normalization.
This function is a helper for R users with less Python experience. Currently it is limited to simple MLPs and with identical layers. More advanced networks will require manual creation with keras.