numopt-js
    Preparing search index...

    Interface CmaEsOptions

    Options for CMA-ES (Covariance Matrix Adaptation Evolution Strategy).

    This implementation follows the vanilla CMA-ES default parameter formulas and core termination criteria used by libcmaes (CMAES_DEFAULT).

    interface CmaEsOptions {
        covarianceRegularization?: number;
        functionTolerance?: number;
        initialStepSize?: number;
        logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR";
        maxFunctionEvaluations?: number;
        maxHistorySize?: number;
        maxIterations?: number;
        maxRestarts?: number;
        onIteration?: (
            iteration: number,
            cost: number,
            parameters: Float64Array,
        ) => void;
        parameterTolerance?: number;
        populationSize?: number;
        profiling?: boolean;
        randomSeed?: number;
        restartStrategy?: "none" | "ipop";
        targetCost?: number;
        tolerance?: number;
        verbose?: boolean;
    }

    Hierarchy (View Summary)

    Index
    covarianceRegularization?: number

    Initial diagonal regularization applied when covariance Cholesky fails. Increase this if you observe repeated numerical failures.

    Default: 1e-12

    functionTolerance?: number

    Function value tolerance for TolHistFun termination criterion. Stops successfully when the range of recent best costs becomes small enough.

    Default: 1e-12 (libcmaes)

    initialStepSize?: number

    Initial distribution step size σ₀ (sigma0 in libcmaes).

    This strongly affects performance; the optimum is ideally within [x0 - σ0, x0 + σ0] (per dimension) in a reasonable scaling of parameters.

    If not provided (or non-positive), falls back to 1 / dim (libcmaes behavior).

    logLevel?: "DEBUG" | "INFO" | "WARN" | "ERROR"

    Log level for detailed logging output. Controls which log messages are displayed:

    • DEBUG: Detailed progress information (cost, gradient norm, step size, etc.)
    • INFO: Convergence messages and important state changes
    • WARN: Warnings (singular matrix, max iterations reached, line search failure, etc.)
    • ERROR: Fatal errors (currently not used, reserved for future extensions)

    If verbose is true and logLevel is not specified, logLevel defaults to INFO. If both logLevel and verbose are specified, logLevel takes precedence. Default: undefined (no logging)

    maxFunctionEvaluations?: number

    Maximum number of objective function evaluations (MAXFEVALS in libcmaes). If specified, CMA-ES stops when the evaluation budget is reached.

    maxHistorySize?: number

    Maximum size of the best-cost history buffer used by termination criteria. If not provided (or non-positive), defaults to: 10 + ceil(30 * dim / λ) (libcmaes)

    maxIterations?: number

    Maximum number of iterations before stopping. Default: 1000

    maxRestarts?: number

    Maximum number of restarts for IPOP. If not provided, defaults to 9 (libcmaes).

    onIteration?: (
        iteration: number,
        cost: number,
        parameters: Float64Array,
    ) => void

    Callback function called at each iteration for progress monitoring. Useful for debugging and monitoring convergence.

    parameterTolerance?: number

    Parameter tolerance for TolX termination criterion. Stops (partial success) when the distribution becomes sufficiently narrow.

    Default: 1e-12 (libcmaes)

    populationSize?: number

    Population size (λ), number of candidate solutions sampled per generation.

    If not provided, uses libcmaes default: λ = 4 + floor(3 * log(dim))

    profiling?: boolean

    Enable lightweight profiling of CMA-ES internal timings. When true, timing breakdown is returned in the result.

    randomSeed?: number

    Random seed for reproducible results.

    libcmaes semantics:

    • seed > 0: deterministic stream
    • seed == 0 or unspecified: auto-generated seed (non-deterministic)
    restartStrategy?: "none" | "ipop"

    Restart strategy for CMA-ES.

    • "none": single run (default)
    • "ipop": increasing population size restarts (λ doubles each restart)
    targetCost?: number

    Objective function target value (FTARGET in libcmaes). If specified, CMA-ES stops successfully when best cost <= targetCost.

    tolerance?: number

    Tolerance for convergence check (gradient norm, step size, etc.). Default: 1e-6

    Levenberg-Marquardt and constrained Levenberg-Marquardt prefer tolGradient / tolStep / tolResidual. If those are omitted, this value is used as a common fallback.

    verbose?: boolean

    Enable verbose logging for debugging. When true, detailed information is logged to console. Default: false

    Use logLevel instead for more fine-grained control. If both logLevel and verbose are specified, logLevel takes precedence.