optuna.samplers.nsgaii.UniformCrossover

class optuna.samplers.nsgaii.UniformCrossover(swapping_prob=0.5)[source]

Uniform Crossover operation used by NSGAIISampler.

Select each parameter with equal probability from the two parent individuals. For further information about uniform crossover, please refer to the following paper:

Parameters:

swapping_prob (float) – Probability of swapping each parameter of the parents during crossover.

Methods

crossover(parents_params, rng, study, ...)

Perform crossover of selected parent individuals.

Attributes

n_parents

crossover(parents_params, rng, study, search_space_bounds)[source]

Perform crossover of selected parent individuals.

This method is called in sample_relative().

Parameters:
  • parents_params (np.ndarray) – A numpy.ndarray with dimensions num_parents x num_parameters. Represents a parameter space for each parent individual. This space is continuous for numerical parameters.

  • rng (np.random.RandomState) – An instance of numpy.random.RandomState.

  • study (Study) – Target study object.

  • search_space_bounds (np.ndarray) – A numpy.ndarray with dimensions len_search_space x 2 representing numerical distribution bounds constructed from transformed search space.

Returns:

A 1-dimensional numpy.ndarray containing new parameter combination.

Return type:

np.ndarray