Table of Contents

Class BaseCrossover

Namespace
OptunaSharp.Samplers.Nsgaii
Assembly
OptunaSharp.dll

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.

public abstract class BaseCrossover
Inheritance
BaseCrossover
Derived
Inherited Members

Properties

NParents

Number of parent individuals required to perform crossover.

public abstract int NParents { get; }

Property Value

int

Methods

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

Perform crossover of selected parent individuals.

public abstract 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.

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.