NSGA3 Class

Non-dominated Sorting Genetic Algorithm with multiple objectives. Based on the implementation by Tatar et al. 1

class spiegelib.estimator.NSGA3(synth, features, seed=None, pop_size=100, ngen=25, cxpb=0.5, mutpb=0.5)

Bases: spiegelib.estimator.estimator_base.EstimatorBase

Parameters
  • synth (Object) – Instance of SynthBase

  • features (list) – A list of FeaturesBase objects. Each feature extraction object defines an objective and is used in the evaluation function to determine fitness of an individual.

  • seed (int, optional) – Seed for random. Defaults to current system time.

  • pop_size (int, optional) – Size of population at each generation

  • ngen (int, optional) – Number of generations to run

  • cxpb (float, optional) – Crossover probability, must be between 0 and 1.

  • mutpb (float, optional) – Mutation probability, must be between 0 and 1.

fitness(individual)

This is automatically called during prediction. Evaluation that calculates the fitness of an individual. The individual is a new estimated synthesizer parameter setting, and fitness is calculated by rendering an audio sample using those parameter settings and then measuring the error between that sample and the target sound using a set of audio feature extractors set during construction.

Parameters

individual (list) – List of float values representing a synthesizer patch

Returns

A list of the error values, one for each feature extractor

Return type

list

predict(input)

Run prection on input audio target

Parameters

input (AudioBuffer) – AudioBuffer to use as target

1

Tatar, Kıvanç, Matthieu Macret, and Philippe Pasquier. “Automatic synthesizer preset generation with PresetGen.” Journal of New Music Research 45.2 (2016): 124-144.