Constructs a multilayer perceptron (MLP) with optional batch normalization and dropout. Used internally by [survdnn()] to define the model architecture.
build_dnn(
input_dim,
hidden,
activation = "relu",
output_dim = 1L,
dropout = 0.3,
batch_norm = TRUE
)A `nn_sequential` object representing the network.
Integer. Number of input features.
Integer vector. Sizes of the hidden layers (e.g., c(32, 16)).
Character. Name of the activation function to use in each layer. Supported options: `"relu"`, `"leaky_relu"`, `"tanh"`, `"sigmoid"`, `"gelu"`, `"elu"`, `"softplus"`.
Integer. Output layer dimension (default = 1).
Numeric between 0 and 1. Dropout rate after each hidden layer (default = 0.3). Set to 0 to disable dropout.
Logical; whether to add `nn_batch_norm1d()` after each hidden linear layer (default = TRUE).