Learn R Programming

pmxNODE (version 0.1.0)

nn_generator_nlmixr: Internal: Generate NN code for nlmixr

Description

Generate the explicit code for a NN in nlmixr

Usage

nn_generator_nlmixr(
  number,
  state,
  n_hidden = 5,
  act = "ReLU",
  time_nn = FALSE,
  beta = 20
)

Value

Explicit NN code in nlmixr as list of lines in nlmixr model file

Arguments

number

(string) Name of the NN

state

(string) State to be used as input of the NN

n_hidden

(numeric) Number of units in the hidden layer, default is 5

act

(string) Activation function to be used in the hidden layer of the NN (currently ReLU and Softplus implemented), default is ReLU

time_nn

(boolean) If NN should be set up specifically as a time-dependent NN with strictly negative weights from input to hidden layer through w'=-w^2

beta

(numeric) Beta value for the Softplus activation function, only applicable if act="Softplus"; Default to 20.

Author

Dominic Bräm

Details

Structure of one unit in the hidden layer:
h1 = W1 * state + b1
if(h1 < 0) {h1 <- 0}
h2 = W2 * state + b2
...
NN = h1 + h2 + ...