Table of Contents

Class UNDXCrossover

Namespace
OptunaSharp.Samplers.Nsgaii
Assembly
OptunaSharp.dll

Unimodal Normal Distribution Crossover used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_undx.py: UNDXCrossover (experimental v3.0.0).

Generates a child from three parents using a multivariate normal distribution.

QR sign parity (n > 1). The orthonormal basis orthogonal to the primary search line comes from np.linalg.qr (LAPACK dgeqrf/dorgqr). QR is unique only up to the signs of R's diagonal, and those signs propagate into the basis vectors: get them wrong and, with two or more numerical parameters, the child values differ from Optuna by O(1), which then cascades through the crowding-distance/non-domination selection and diverges the whole study trajectory. So the basis is computed through QrQ(double[,]) (OpenBLAS/LAPACK — column signs byte-identical to NumPy) whenever the native backend is present, which is the normal case and gives full Optuna parity here (to the ~1e-14 managed-vs-LAPACK tolerance the downstream selection is insensitive to).

[Misaligned] no-native (Tier N) fallback. Without OpenBLAS the basis falls back to a managed Householder QR (HouseholderQ(double[,], int)) that matches numpy's magnitudes to ~1e-14 but not its per-column signs (its accumulated Q = Q·Hₖ flips signs vs orgqr). UNDX still samples correctly — etas ~ N(0, σ²) is symmetric, so a sign-flipped basis is a valid draw and the study stays in RNG lock-step within OptunaSharp — but its trajectory can sign-diverge from Optuna for ≥2-numerical-parameter spaces. A single numerical parameter is bit-exact on either path (the basis is unused).

public class UNDXCrossover : BaseCrossover
Inheritance
UNDXCrossover
Inherited Members

Constructors

UNDXCrossover(double, double?)

Configures normal offspring variation along and perpendicular to the primary parent axis.

public UNDXCrossover(double sigmaXi = 0.5, double? sigmaEta = null)

Parameters

sigmaXi double

Parametrizes the normal distribution from which xi is drawn.

sigmaEta double?

Parametrizes the normal distribution from which etas are drawn. Defaults to 0.35 / sqrt(len(search_space)).

Properties

NParents

Number of parent individuals required to perform crossover.

public override int NParents { get; }

Property Value

int

Methods

Crossover(double[][], NumPyRandom, Study, double[,])

Perform crossover of selected parent individuals.

public override double[] Crossover(double[][] parentsParams, NumPyRandom rng, Study study, double[,] searchSpaceBounds)

Parameters

parentsParams double[][]

A num_parents x num_parameters array. Represents a parameter space for each parent individual (continuous for numerical parameters). Row i is parent i.

rng NumPyRandom

An instance of numpy.random.RandomState.

study Study

Target study object.

searchSpaceBounds double[,]

A len_search_space x 2 array of numerical distribution bounds constructed from the transformed search space. Column 0 is lower, column 1 is upper.

Returns

double[]

A 1-dimensional array containing the new parameter combination.