Table of Contents

Class NSGAIIChildGenerationStrategy

Namespace
OptunaSharp.Samplers.Nsgaii
Assembly
OptunaSharp.dll

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.

public class NSGAIIChildGenerationStrategy
Inheritance
NSGAIIChildGenerationStrategy
Inherited Members

Constructors

NSGAIIChildGenerationStrategy(BaseMutation?, double?, BaseCrossover, double, double, Func<FrozenTrial, IEnumerable<double>>?, LazyRandomState)

Configures the genetic operators and selection randomness used for offspring.

public NSGAIIChildGenerationStrategy(BaseMutation? mutation, double? mutationProb, BaseCrossover crossover, double crossoverProb, double swappingProb, Func<FrozenTrial, IEnumerable<double>>? constraintsFunc, LazyRandomState rng)

Parameters

mutation BaseMutation

Numerical mutation operator used when an offspring coordinate is selected for mutation.

mutationProb double?

Per-parameter mutation probability; null selects the operator default.

crossover BaseCrossover

Operator combining the selected numerical parent vectors.

crossoverProb double

Probability of applying crossover to a mating.

swappingProb double

Probability of taking a coordinate from the alternate parent.

constraintsFunc Func<FrozenTrial, IEnumerable<double>>

Optional legacy callback returning constraint values; positive values violate a constraint.

rng LazyRandomState

Random stream whose draw order is shared with the reference algorithm.

Exceptions

ValueError

A mutation, crossover, or swapping probability is outside its supported interval.

Methods

Generate(Study, OrderedDict<string, BaseDistribution>, List<FrozenTrial>)

Generate a child parameter dict from the given parent population (Python call).

public OrderedDict<string, object?> Generate(Study study, OrderedDict<string, BaseDistribution> searchSpace, List<FrozenTrial> parentPopulation)

Parameters

study Study

Study supplying trial history, objective directions, and storage.

searchSpace OrderedDict<string, BaseDistribution>

Ordered parameter distributions defining the coordinates used by this operation.

parentPopulation List<FrozenTrial>

Eligible parent trials from the current generation.

Returns

OrderedDict<string, object>

External offspring parameter values produced by the configured reproduction strategy.