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
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
parentsParamsdouble[][]A
num_parents x num_parametersarray. Represents a parameter space for each parent individual (continuous for numerical parameters). Rowiis parenti.rngNumPyRandomAn instance of
numpy.random.RandomState.studyStudyTarget study object.
searchSpaceBoundsdouble[,]A
len_search_space x 2array 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.