% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/model_2.R
\name{model_2}
\alias{model_2}
\title{model_2 Neural Network Module}
\usage{
model_2(input_size, nhidden, nlayers, dropout, n_clusters, n_dummy_demov_fea, para_cuda)
}
\arguments{
\item{input_size}{Integer. Number of features in the input data.}

\item{nhidden}{Integer. Number of hidden units in each LSTM layer.}

\item{nlayers}{Integer. Number of LSTM layers.}

\item{dropout}{Numeric. Dropout probability between LSTM layers (0–1).}

\item{n_clusters}{Integer. Number of clusters/classes.}

\item{n_dummy_demov_fea}{Integer. Number of demographic dummy features.}

\item{para_cuda}{Logical. Whether to use CUDA (GPU acceleration).

The \code{forward()} method arguments:
\code{"get_representation"}, \code{"classifier"},
\code{"outcome_logistic_regression"}.}
}
\value{
An \code{nn_module} object.
}
\description{
A neural network module implementing a multi-functional model with
encoder-decoder architecture using the \code{torch} package.
The module is constructed using \code{nn_module()} and configured
via its \code{initialize()} method.
}
\details{
After initialization, the module can be used via
\code{model$forward(x, function_name, demov = NULL, mask_BoolTensor = NULL)}.

Arguments:
\itemize{
\item \code{x}: Input tensor.
\item \code{function_name}: One of "autoencoder",
"get_representation", "classifier",
"outcome_logistic_regression".
\item \code{demov}: Optional demographic tensor.
\item \code{mask_BoolTensor}: Optional boolean mask tensor.
}
}
\examples{
\donttest{
if (requireNamespace("torch", quietly = TRUE)) {
  mod <- model_2(
    input_size = 10L, nhidden = 64L, nlayers = 2L, dropout = 0.1,
    n_clusters = 3L, n_dummy_demov_fea = 2L, para_cuda = FALSE
  )
}
}

}
