% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/torch_cla_mlp.R
\name{torch_cla_mlp}
\alias{torch_cla_mlp}
\title{PyTorch MLP Classifier}
\usage{
torch_cla_mlp(
  attribute,
  slevels,
  preprocess = NA,
  input_size,
  hidden_sizes,
  num_classes = length(slevels),
  dropout = 0,
  activation = c("relu", "leaky_relu", "elu", "gelu", "tanh"),
  normalization = c("none", "batch", "layer"),
  init_method = c("default", "xavier_uniform", "xavier_normal", "kaiming_uniform",
    "kaiming_normal"),
  epochs = 100L,
  lr = 0.001,
  validation_strategy = c("static", "dynamic"),
  stopping_rule = c("none", "patience", "sma", "ema", "h"),
  val_ratio = 0.2,
  batch_size = 64L,
  patience = 100L,
  min_delta = 1e-04,
  sma_window = 5L,
  ema_alpha = 0.2,
  test_window = 30L,
  p_value = 0.05,
  weight_decay = 0
)
}
\arguments{
\item{attribute}{Target attribute name.}

\item{slevels}{Vector with valid class labels.}

\item{preprocess}{Optional preprocessing object.}

\item{input_size}{Integer. Number of input attributes.}

\item{hidden_sizes}{Integer vector with hidden layer sizes.}

\item{num_classes}{Integer. Number of classes. Defaults to \code{length(slevels)}.}

\item{dropout}{Numeric. Dropout rate.}

\item{activation}{Character. Hidden activation function. One of
\code{"relu"}, \code{"leaky_relu"}, \code{"elu"}, \code{"gelu"}, or \code{"tanh"}.}

\item{normalization}{Character. Optional normalization after each hidden linear layer.
One of \code{"none"}, \code{"batch"}, or \code{"layer"}.}

\item{init_method}{Character. Weight initialization strategy. One of
\code{"default"}, \code{"xavier_uniform"}, \code{"xavier_normal"}, \code{"kaiming_uniform"}, or \code{"kaiming_normal"}.}

\item{epochs}{Integer. Maximum number of epochs. Default is \code{100L}.}

\item{lr}{Numeric. Learning rate.}

\item{validation_strategy}{Character. One of \code{static} or \code{dynamic}.}

\item{stopping_rule}{Character. One of \code{none}, \code{patience}, \code{sma}, \code{ema}, or \code{h}.}

\item{val_ratio}{Numeric. Validation fraction used when validation is enabled.}

\item{batch_size}{Integer. Mini-batch size.}

\item{patience}{Integer. Early stopping patience.}

\item{min_delta}{Numeric. Minimum improvement to reset early stopping.}

\item{sma_window}{Integer. Window size used by \code{sma}.}

\item{ema_alpha}{Numeric. Smoothing factor used by \code{ema}.}

\item{test_window}{Integer. Window size used by \code{h}.}

\item{p_value}{Numeric. Significance threshold used by \code{h}.}

\item{weight_decay}{Numeric. L2 regularization.}
}
\description{
Classification model backed by a configurable PyTorch MLP with unified training strategies.
}
\examples{
\dontrun{
library(daltoolboxdp)
model <- torch_cla_mlp(
  attribute = "class",
  slevels = c("A", "B"),
  input_size = 10,
  hidden_sizes = c(64L, 32L),
  normalization = "batch",
  init_method = "kaiming_uniform",
  epochs = 1000L
)
}
}
