% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/RcppExports.R
\name{maxent_sequential_train}
\alias{maxent_sequential_train}
\title{Train a FeaturedSpace with the Sequential optimizer (trajectory-capable)}
\usage{
maxent_sequential_train(
  fs_ptr,
  max_iter = 500L,
  convergence = 1e-05,
  beta_multiplier = 1,
  min_deviation = 0.001,
  parallel_update_frequency = 10L,
  disable_convergence_test = FALSE,
  trajectory_iterations = as.integer(c())
)
}
\arguments{
\item{fs_ptr}{External pointer to a FeaturedSpace object.}

\item{max_iter}{Maximum number of iterations (default 500).}

\item{convergence}{Convergence threshold on \code{newLoss - oldLoss}
(default \code{1e-5}).  Ignored when \code{disable_convergence_test=TRUE}.}

\item{beta_multiplier}{Regularization multiplier (default 1.0).}

\item{min_deviation}{Minimum sample deviation floor (default 0.001).}

\item{parallel_update_frequency}{Iteration frequency at which
\code{doParallelUpdate} runs (default 10, matching Java).}

\item{disable_convergence_test}{When \code{TRUE}, the loop runs a fixed
\code{max_iter} iterations with no early stop.  Needed for deterministic
per-iteration trajectory comparisons against the Java oracle.}

\item{trajectory_iterations}{Integer vector of 1-based iteration indices
at which to capture \code{(loss, entropy, lambdas)} snapshots.  May be
empty.  Snapshots outside \code{[1, max_iter]} are silently dropped.}
}
\value{
Named list with elements:
  \code{loss}, \code{entropy}, \code{iterations}, \code{converged},
  \code{lambdas}, and \code{trajectory} — a data.frame with columns
  \code{iteration, loss, entropy, lambda_0, ..., lambda_{J-1}} holding
  one row per requested checkpoint that was actually reached.
}
\description{
Runs the full \code{density.Sequential} optimizer ported from the original
Java Maxent, with optional per-iteration trajectory snapshots.  Unlike
\code{maxent_train()} which uses a \code{goodAlpha}-only loop, this trainer
reproduces the real Java optimizer's feature-selection (\code{deltaLossBound}),
Newton step, 1-D line search, and every-10-iter \code{doParallelUpdate}
with undo on loss-violating batch steps.
}
\keyword{internal}
