| build_dnn | R Documentation |
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
)
input_dim |
Integer. Number of input features. |
|
Integer vector. Sizes of the hidden layers (e.g., c(32, 16)). | |
activation |
Character. Name of the activation function to use in each layer. Supported options: '"relu"', '"leaky_relu"', '"tanh"', '"sigmoid"', '"gelu"', '"elu"', '"softplus"'. |
output_dim |
Integer. Output layer dimension (default = 1). |
dropout |
Numeric between 0 and 1. Dropout rate after each hidden layer (default = 0.3). Set to 0 to disable dropout. |
batch_norm |
Logical; whether to add 'nn_batch_norm1d()' after each hidden linear layer (default = TRUE). |
A 'nn_sequential' object representing the network.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.