build_dnn {survdnn}R Documentation

Build a Deep Neural Network for Survival Analysis

Description

Constructs a multilayer perceptron (MLP) with batch normalization, activation functions, and dropout. Used internally by [survdnn()] to define the model architecture.

Usage

build_dnn(input_dim, hidden, activation = "relu", output_dim = 1L)

Arguments

input_dim

Integer. Number of input features.

hidden

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).

Value

A 'nn_sequential' object representing the network.

Examples

net <- build_dnn(10, hidden = c(64, 32), activation = "relu")

[Package survdnn version 0.6.0 Index]