% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/autoenc_variational_e.R
\name{autoenc_variational_e}
\alias{autoenc_variational_e}
\title{Variational Autoencoder - Encode}
\usage{
autoenc_variational_e(
  input_size,
  encoding_size,
  encoder_hidden_sizes = c(64L, 32L),
  decoder_hidden_sizes = NULL,
  activation = c("leaky_relu", "relu", "elu", "gelu", "tanh"),
  negative_slope = 0.2,
  output_activation = c("sigmoid", "none", "relu", "tanh", "softplus"),
  reconstruction_loss = c("bce", "mse"),
  batch_size = 32,
  epochs = 100L,
  num_epochs = NULL,
  learning_rate = 0.001,
  validation_strategy = c("static", "dynamic"),
  stopping_rule = c("none", "patience", "sma", "ema", "h"),
  val_ratio = 0.3,
  patience = 100L,
  min_delta = 1e-04,
  sma_window = 5L,
  ema_alpha = 0.2,
  test_window = 30L,
  p_value = 0.05
)
}
\arguments{
\item{input_size}{Integer. Number of input features per observation.}

\item{encoding_size}{Integer. Size of the latent (bottleneck) representation.}

\item{encoder_hidden_sizes}{Integer vector used by the encoder backbone. Default is
\code{c(64L, 32L)}, matching the previous implementation.}

\item{decoder_hidden_sizes}{Optional integer vector used by the decoder backbone.
If \code{NULL}, the decoder mirrors \code{encoder_hidden_sizes} in reverse order.}

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

\item{negative_slope}{Numeric. Negative slope used when \code{activation = "leaky_relu"}.}

\item{output_activation}{Character. Output activation of the decoder. One of
\code{"sigmoid"}, \code{"none"}, \code{"relu"}, \code{"tanh"}, or \code{"softplus"}.}

\item{reconstruction_loss}{Character. Reconstruction term used in the ELBO. One of
\code{"bce"} or \code{"mse"}.}

\item{batch_size}{Integer. Mini-batch size used during training. Default is 32.}

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

\item{num_epochs}{Deprecated compatibility alias for \code{epochs}. If informed, it overrides \code{epochs}.}

\item{learning_rate}{Numeric. Optimizer learning rate. Default is 0.001.}

\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. Default is 0.3.}

\item{patience}{Integer. Early stopping patience. Default is 100.}

\item{min_delta}{Numeric. Minimum improvement to reset early stopping. Default is 1e-4.}

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

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

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

\item{p_value}{Numeric. Significance threshold used by \code{h}. Default is 0.05.}
}
\value{
A \code{autoenc_variational_e} object.
}
\description{
Creates a variational autoencoder (VAE) with configurable dense encoder/decoder
blocks through a Python/PyTorch backend.
}
\details{
The VAE now exposes the hidden layout of both encoder and decoder, the activation family,
the latent reconstruction head, and the reconstruction loss. This makes it possible to
move from the original \code{64 -> 32 -> latent} structure to deeper or shallower alternatives.
}
\examples{
\dontrun{
X <- matrix(rnorm(1000), nrow = 50, ncol = 20)
ae <- autoenc_variational_e(
  input_size = 20,
  encoding_size = 5,
  encoder_hidden_sizes = c(128L, 64L, 32L),
  reconstruction_loss = "mse"
)
ae <- daltoolbox::fit(ae, X)
Z <- daltoolbox::transform(ae, X)
dim(Z)
}

}
\references{
Kingma, D. P., & Welling, M. (2014). Auto-Encoding Variational Bayes.
}
