Generate the explicit code for a NN in NONMEM
nn_generator_nm(
number,
state,
n_hidden = 5,
act = "ReLU",
time_nn = FALSE,
beta = 20
)Explicit NN code in NONMEM as list of lines in NONMEM model file
(string) Name of the NN
(string) State to be used as input of the NN
(numeric) Number of units in the hidden layer; currently not implemented for the NN function
(string) Activation function to be used in the hidden layer of the NN (currently ReLU and Softplus implemented), default is ReLU
(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
(numeric) Beta value for the Softplus activation function, only applicable if act="Softplus"; Default to 20.
Dominic Bräm
Structure of one unit in the hidden layer:
h1 = 0
h1_thres = W1 * state + b1
IF (h1_thres.GT.h1) h1 = h1_thres
h2 = 0
...
NN = h1 + h2 + ...