Table of Contents

Namespace OptunaSharp.Samplers.Nsgaii

Classes

BLXAlphaCrossover

Blend Crossover operation used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_blxalpha.py: BLXAlphaCrossover (experimental v3.0.0).

Uniformly samples child individuals from the hyper-rectangles created by the two parent individuals.

BaseCrossover

Base class for crossovers. Port of optuna/samplers/nsgaii/_crossovers/_base.py: BaseCrossover.

A crossover operation is used by NSGAIISampler to create new parameter combinations from parameters of n parent individuals.

Concrete implementations of this class are expected to only accept parameters from numerical distributions. Only crossover for categorical parameters (uniform crossover) is built into NSGAIISampler.

BaseMutation

Base class for mutations. Port of optuna/samplers/nsgaii/_mutations/_base.py: BaseMutation (experimental v5.0.0).

A mutation operation is used by NSGAIISampler to mutate a numerical parameter when creating a new individual.

NSGAIIAfterTrialStrategy

The default after-trial strategy of NSGAIISampler. Port of optuna/samplers/nsgaii/_after_trial_strategy.py: NSGAIIAfterTrialStrategy.

Examines whether the trial result is valid in terms of constraints and stores the results in the study's system attributes (only when a constraints_func is configured).

NSGAIIChildGenerationStrategy

The default child-generation strategy of NSGAIISampler. Port of optuna/samplers/nsgaii/_child_generation_strategy.py: NSGAIIChildGenerationStrategy.

With probability crossover_prob a child is produced by crossover of tournament-selected parents; otherwise a single parent is copied. Each parameter is then mutated with probability mutation_prob (defaulting to 1 / len(params)): if a mutation object is set the value is mutated in place, otherwise the parameter is dropped and later resampled independently.

This is a bit-exact Optuna port. The conditional-parameter ("Categorical Parameter Trees") counterpart that evolves branch-defined parameters is NsgaiiiCptChildGenerationStrategy, used by NSGAIIICptSampler.

NSGAIIElitePopulationSelectionStrategy

The default elite-population selection strategy of NSGAIISampler. Port of optuna/samplers/nsgaii/_elite_population_selection_strategy.py.

Ranks the combined population by (constrained) non-domination, then fills the elite population rank by rank; the rank that overflows population_size is truncated by crowding distance (descending). The resulting order is load-bearing — it seeds the parent population that later generations index into with rng.choice.

PolynomialMutation

Polynomial mutation operation used by NSGAIISampler. Port of optuna/samplers/nsgaii/_mutations/_polynomial.py: PolynomialMutation (experimental v5.0.0).

Mutates a real-valued parameter according to the polynomial probability distribution, following revision 1.1.6 of the original NSGA-II C implementation.

SBXCrossover

Simulated Binary Crossover operation used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_sbx.py: SBXCrossover (experimental v3.0.0).

Generates a child from two parent individuals according to the polynomial probability distribution. Optuna returns only one child, so it uses uniform_crossover_prob and use_child_gene_prob to collapse the two SBX children into one.

SPXCrossover

Simplex Crossover operation used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_spx.py: SPXCrossover (experimental v3.0.0).

Uniformly samples child individuals from within a single simplex similar to the simplex produced by the (three) parent individuals.

UNDXCrossover

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).

UniformCrossover

Uniform Crossover operation used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_uniform.py: UniformCrossover.

Select each parameter with equal probability from the two parent individuals.

VSBXCrossover

Modified Simulated Binary Crossover (vSBX) used by NSGAIISampler. Port of optuna/samplers/nsgaii/_crossovers/_vsbx.py: VSBXCrossover (experimental v3.0.0).

vSBX generates child individuals without excluding any region of the parameter space while maintaining the properties of SBX.