Example for evolutionary regression

Example demonstrating the use of Cartesian genetic programming for two regression tasks.

# The docopt str is added explicitly to ensure compatibility with
# sphinx-gallery.
docopt_str = """
   Usage:
     example_evo_regression.py [--max-generations=<N>]

   Options:
     -h --help
     --max-generations=<N>  Maximum number of generations [default: 1000]
"""

import functools
import warnings

import matplotlib.pyplot as plt
import numpy as np
import scipy.constants
from docopt import docopt

import cgp

args = docopt(docopt_str)

We first define target functions. For illustration purposes, we define two functions which present different levels of difficulty for the search.

def f_target_easy(x):
    return x[:, 0] ** 2 + 2 * x[:, 0] * x[:, 1] + x[:, 1] ** 2


def f_target_hard(x):
    return 1.0 + 1.0 / (x[:, 0] + x[:, 1])

Then we define the objective function for the evolution. It uses the mean-squared error between the expression represented by a given individual and the target function evaluated on a set of random points.

def objective(individual, target_function, seed):
    """Objective function of the regression task.

    Parameters
    ----------
    individual : Individual
        Individual of the Cartesian Genetic Programming Framework.
    target_function : Callable
        Target function.

    Returns
    -------
    Individual
        Modified individual with updated fitness value.
    """
    if not individual.fitness_is_None():
        return individual

    n_function_evaluations = 1000

    np.random.seed(seed)

    f_graph = individual.to_func()
    y = np.empty(n_function_evaluations)
    x = np.random.uniform(-4, 4, size=(n_function_evaluations, 2))
    for i, x_i in enumerate(x):
        with warnings.catch_warnings():  # ignore warnings due to zero division
            warnings.filterwarnings(
                "ignore", message="divide by zero encountered in double_scalars"
            )
            warnings.filterwarnings(
                "ignore", message="invalid value encountered in double_scalars"
            )
            try:
                y[i] = f_graph(x_i[0], x_i[1])
            except ZeroDivisionError:
                individual.fitness = -np.inf
                return individual

    loss = np.mean((target_function(x) - y) ** 2)
    individual.fitness = -loss

    return individual

Next, we define the main loop of the evolution. To easily execute it for different target functions, we wrap it into a function here. It comprises:

  • defining the parameters for the population, the genome of individuals, and the evolutionary algorithm.

  • creating a Population instance and instantiating the evolutionary algorithm.

  • defining a recording callback closure for bookkeeping of the progression of the evolution.

Finally, we call the evolve method to perform the evolutionary search.

def evolution(f_target):
    """Execute CGP on a regression task for a given target function.

    Parameters
    ----------
    f_target : Callable
        Target function

    Returns
    -------
    dict
        Dictionary containing the history of the evolution
    Individual
        Individual with the highest fitness in the last generation
    """
    population_params = {"n_parents": 10, "seed": 818821}

    genome_params = {
        "n_inputs": 2,
        "n_outputs": 1,
        "n_columns": 12,
        "n_rows": 2,
        "levels_back": 5,
        "primitives": (cgp.Add, cgp.Sub, cgp.Mul, cgp.Div, cgp.ConstantFloat),
    }

    ea_params = {"n_offsprings": 10, "tournament_size": 2, "mutation_rate": 0.03, "n_processes": 2}

    evolve_params = {"max_generations": int(args["--max-generations"]), "termination_fitness": 0.0}

    # create population that will be evolved
    pop = cgp.Population(**population_params, genome_params=genome_params)

    # create instance of evolutionary algorithm
    ea = cgp.ea.MuPlusLambda(**ea_params)

    # define callback for recording of fitness over generations
    history = {}
    history["fitness_parents"] = []

    def recording_callback(pop):
        history["fitness_parents"].append(pop.fitness_parents())

    # the objective passed to evolve should only accept one argument,
    # the individual
    obj = functools.partial(objective, target_function=f_target, seed=population_params["seed"])

    # Perform the evolution
    cgp.evolve(pop, obj, ea, **evolve_params, print_progress=True, callback=recording_callback)
    return history, pop.champion

We execute the evolution for the two different target functions (‘easy’ and ‘hard’). After finishing the evolution, we plot the result and log the final evolved expression.

if __name__ == "__main__":
    width = 9.0
    fig, axes = plt.subplots(2, 2, figsize=(width, width / scipy.constants.golden))

    for i, (label, target_function) in enumerate(
        zip(["easy", "hard"], [f_target_easy, f_target_hard])
    ):
        history, champion = evolution(target_function)

        ax_fitness, ax_function = axes[i]
        ax_fitness.set_xlabel("Generation")
        ax_fitness.set_ylabel("Fitness")

        history_fitness = np.array(history["fitness_parents"])
        ax_fitness.plot(np.max(history_fitness, axis=1), label="Champion")
        ax_fitness.plot(np.mean(history_fitness, axis=1), label="Population mean")

        ax_fitness.set_yscale("symlog")
        ax_fitness.set_ylim(-1.0e4, 0.0)
        ax_fitness.legend()

        f_graph = champion.to_func()
        x_0_range = np.linspace(-5.0, 5.0, 20)
        x_1_range = np.ones_like(x_0_range) * 2.0
        # fix x_1 such than 1d plot makes sense
        y = [f_graph(x_0, x_1_range[0]) for x_0 in x_0_range]
        y_target = target_function(np.hstack([x_0_range.reshape(-1, 1), x_1_range.reshape(-1, 1)]))

        ax_function.plot(x_0_range, y_target, lw=2, alpha=0.5, label="Target")
        ax_function.plot(x_0_range, y, "x", label="Champion")
        ax_function.legend()
        ax_function.set_ylabel(r"$f(x)$")
        ax_function.set_xlabel(r"$x$")

    fig.savefig("example_evo_regression.pdf")
example evo regression

Out:

[2/1000] max fitness: -269.9919395803643
[3/1000] max fitness: -269.9919395803643
[4/1000] max fitness: -269.9919395803643
[5/1000] max fitness: -269.9919395803643
[6/1000] max fitness: -269.9919395803643
[7/1000] max fitness: -263.531183672255
[8/1000] max fitness: -263.531183672255
[9/1000] max fitness: -263.531183672255
[10/1000] max fitness: -251.52289510576531
[11/1000] max fitness: -181.76692589107245
[12/1000] max fitness: -181.76692589107245
[13/1000] max fitness: -55.09260003381215
[14/1000] max fitness: -55.09260003381215
[15/1000] max fitness: -55.09260003381215
[16/1000] max fitness: -55.09260003381215
[17/1000] max fitness: -55.09260003381215
[18/1000] max fitness: -10.734522237299498
[19/1000] max fitness: -10.734522237299498
[20/1000] max fitness: -10.734522237299498
[21/1000] max fitness: -10.734522237299498
[22/1000] max fitness: -10.734522237299498
[23/1000] max fitness: -10.734522237299498
[24/1000] max fitness: -0.9999999999999998
[25/1000] max fitness: -0.9999999999999998
[26/1000] max fitness: -0.9999999999999998
[27/1000] max fitness: -0.9999999999999998
[28/1000] max fitness: -4.34591243726438e-30

[2/1000] max fitness: -25413.685133370906
[3/1000] max fitness: -25413.685133370906
[4/1000] max fitness: -25411.256198202307
[5/1000] max fitness: -25402.213805007177
[6/1000] max fitness: -13839.638415376236
[7/1000] max fitness: -13839.638415376236
[8/1000] max fitness: -13839.638415376236
[9/1000] max fitness: -13839.638415376236
[10/1000] max fitness: -13839.638415376236
[11/1000] max fitness: -5755.344202651551
[12/1000] max fitness: -5755.344202651551
[13/1000] max fitness: -5755.344202651551
[14/1000] max fitness: -5755.344202651551
[15/1000] max fitness: -5755.344202651551
[16/1000] max fitness: -5755.344202651551
[17/1000] max fitness: -5755.344202651551
[18/1000] max fitness: -5755.344202651551
[19/1000] max fitness: -5755.344202651551
[20/1000] max fitness: -5755.344202651551
[21/1000] max fitness: -5755.344202651551
[22/1000] max fitness: -5755.344202651551
[23/1000] max fitness: -5755.344202651551
[24/1000] max fitness: -5755.344202651551
[25/1000] max fitness: -5755.344202651551
[26/1000] max fitness: -5755.344202651551
[27/1000] max fitness: -5755.344202651551
[28/1000] max fitness: -5755.344202651551
[29/1000] max fitness: -5755.344202651551
[30/1000] max fitness: -5755.344202651551
[31/1000] max fitness: -5755.344202651551
[32/1000] max fitness: -5755.344202651551
[33/1000] max fitness: -5755.344202651551
[34/1000] max fitness: -5755.344202651551
[35/1000] max fitness: -5755.344202651551
[36/1000] max fitness: -5755.344202651551
[37/1000] max fitness: -5755.344202651551
[38/1000] max fitness: -5755.344202651551
[39/1000] max fitness: -5755.344202651551
[40/1000] max fitness: -5755.344202651551
[41/1000] max fitness: -5755.344202651551
[42/1000] max fitness: -5755.344202651551
[43/1000] max fitness: -5755.344202651551
[44/1000] max fitness: -5755.344202651551
[45/1000] max fitness: -5755.344202651551
[46/1000] max fitness: -5755.344202651551
[47/1000] max fitness: -5755.344202651551
[48/1000] max fitness: -5755.344202651551
[49/1000] max fitness: -5755.344202651551
[50/1000] max fitness: -5755.344202651551
[51/1000] max fitness: -5755.344202651551
[52/1000] max fitness: -5755.344202651551
[53/1000] max fitness: -5755.344202651551
[54/1000] max fitness: -5755.344202651551
[55/1000] max fitness: -5755.344202651551
[56/1000] max fitness: -5755.344202651551
[57/1000] max fitness: -5755.344202651551
[58/1000] max fitness: -5755.344202651551
[59/1000] max fitness: -5755.344202651551
[60/1000] max fitness: -5755.344202651551
[61/1000] max fitness: -5755.344202651551
[62/1000] max fitness: -5755.344202651551
[63/1000] max fitness: -5755.344202651551
[64/1000] max fitness: -5755.344202651551
[65/1000] max fitness: -5755.344202651551
[66/1000] max fitness: -5755.344202651551
[67/1000] max fitness: -5755.344202651551
[68/1000] max fitness: -5755.344202651551
[69/1000] max fitness: -5755.344202651551
[70/1000] max fitness: -5755.344202651551
[71/1000] max fitness: -5755.344202651551
[72/1000] max fitness: -5755.344202651551
[73/1000] max fitness: -5755.344202651551
[74/1000] max fitness: -5755.344202651551
[75/1000] max fitness: -5755.344202651551
[76/1000] max fitness: -5755.344202651551
[77/1000] max fitness: -5755.344202651551
[78/1000] max fitness: -5755.344202651551
[79/1000] max fitness: -5755.344202651551
[80/1000] max fitness: -5755.344202651551
[81/1000] max fitness: -5755.344202651551
[82/1000] max fitness: -5755.344202651551
[83/1000] max fitness: -5755.344202651551
[84/1000] max fitness: -5755.344202651551
[85/1000] max fitness: -5755.344202651551
[86/1000] max fitness: -5755.344202651551
[87/1000] max fitness: -5755.344202651551
[88/1000] max fitness: -5755.344202651551
[89/1000] max fitness: -5755.344202651551
[90/1000] max fitness: -5755.344202651551
[91/1000] max fitness: -5755.344202651551
[92/1000] max fitness: -5755.344202651551
[93/1000] max fitness: -5755.344202651551
[94/1000] max fitness: -5755.344202651551
[95/1000] max fitness: -5755.344202651551
[96/1000] max fitness: -5755.344202651551
[97/1000] max fitness: -5755.344202651551
[98/1000] max fitness: -5755.344202651551
[99/1000] max fitness: -5755.344202651551
[100/1000] max fitness: -5755.344202651551
[101/1000] max fitness: -5755.344202651551
[102/1000] max fitness: -5755.344202651551
[103/1000] max fitness: -5755.344202651551
[104/1000] max fitness: -5755.344202651551
[105/1000] max fitness: -5755.344202651551
[106/1000] max fitness: -5755.344202651551
[107/1000] max fitness: -5755.344202651551
[108/1000] max fitness: -5755.344202651551
[109/1000] max fitness: -5755.344202651551
[110/1000] max fitness: -5755.344202651551
[111/1000] max fitness: -5755.344202651551
[112/1000] max fitness: -5755.344202651551
[113/1000] max fitness: -5755.344202651551
[114/1000] max fitness: -5755.344202651551
[115/1000] max fitness: -5755.344202651551
[116/1000] max fitness: -5755.344202651551
[117/1000] max fitness: -5755.344202651551
[118/1000] max fitness: -5755.344202651551
[119/1000] max fitness: -5755.344202651551
[120/1000] max fitness: -5755.344202651551
[121/1000] max fitness: -5755.344202651551
[122/1000] max fitness: -5755.344202651551
[123/1000] max fitness: -5755.344202651551
[124/1000] max fitness: -5755.344202651551
[125/1000] max fitness: -5755.344202651551
[126/1000] max fitness: -5755.344202651551
[127/1000] max fitness: -5755.344202651551
[128/1000] max fitness: -5755.344202651551
[129/1000] max fitness: -5755.344202651551
[130/1000] max fitness: -5755.344202651551
[131/1000] max fitness: -5755.344202651551
[132/1000] max fitness: -5755.344202651551
[133/1000] max fitness: -5755.344202651551
[134/1000] max fitness: -5755.344202651551
[135/1000] max fitness: -5755.344202651551
[136/1000] max fitness: -5755.344202651551
[137/1000] max fitness: -5755.344202651551
[138/1000] max fitness: -5755.344202651551
[139/1000] max fitness: -5755.344202651551
[140/1000] max fitness: -5755.344202651551
[141/1000] max fitness: -5755.344202651551
[142/1000] max fitness: -5755.344202651551
[143/1000] max fitness: -5755.344202651551
[144/1000] max fitness: -5755.344202651551
[145/1000] max fitness: -5755.344202651551
[146/1000] max fitness: -5755.344202651551
[147/1000] max fitness: -5755.344202651551
[148/1000] max fitness: -5755.344202651551
[149/1000] max fitness: -5755.344202651551
[150/1000] max fitness: -5755.344202651551
[151/1000] max fitness: -5755.344202651551
[152/1000] max fitness: -5755.344202651551
[153/1000] max fitness: -5755.344202651551
[154/1000] max fitness: -5755.344202651551
[155/1000] max fitness: -5755.344202651551
[156/1000] max fitness: -5755.344202651551
[157/1000] max fitness: -5755.344202651551
[158/1000] max fitness: -5755.344202651551
[159/1000] max fitness: -5755.344202651551
[160/1000] max fitness: -5755.344202651551
[161/1000] max fitness: -5755.344202651551
[162/1000] max fitness: -5755.344202651551
[163/1000] max fitness: -5755.344202651551
[164/1000] max fitness: -5755.344202651551
[165/1000] max fitness: -5755.344202651551
[166/1000] max fitness: -5755.344202651551
[167/1000] max fitness: -5755.344202651551
[168/1000] max fitness: -5755.344202651551
[169/1000] max fitness: -5755.344202651551
[170/1000] max fitness: -5755.344202651551
[171/1000] max fitness: -5755.344202651551
[172/1000] max fitness: -5755.344202651551
[173/1000] max fitness: -5755.344202651551
[174/1000] max fitness: -5755.344202651551
[175/1000] max fitness: -5755.344202651551
[176/1000] max fitness: -5755.344202651551
[177/1000] max fitness: -5755.344202651551
[178/1000] max fitness: -5755.344202651551
[179/1000] max fitness: -5755.344202651551
[180/1000] max fitness: -5755.344202651551
[181/1000] max fitness: -5755.344202651551
[182/1000] max fitness: -5755.344202651551
[183/1000] max fitness: -5755.344202651551
[184/1000] max fitness: -5755.344202651551
[185/1000] max fitness: -5755.344202651551
[186/1000] max fitness: -5755.344202651551
[187/1000] max fitness: -5755.344202651551
[188/1000] max fitness: -5755.344202651551
[189/1000] max fitness: -5755.344202651551
[190/1000] max fitness: -5755.344202651551
[191/1000] max fitness: -5755.344202651551
[192/1000] max fitness: -5755.344202651551
[193/1000] max fitness: -5755.344202651551
[194/1000] max fitness: -5755.344202651551
[195/1000] max fitness: -5755.344202651551
[196/1000] max fitness: -5755.344202651551
[197/1000] max fitness: -5755.344202651551
[198/1000] max fitness: -5755.344202651551
[199/1000] max fitness: -5755.344202651551
[200/1000] max fitness: -5755.344202651551
[201/1000] max fitness: -5755.344202651551
[202/1000] max fitness: -5755.344202651551
[203/1000] max fitness: -5755.344202651551
[204/1000] max fitness: -5755.344202651551
[205/1000] max fitness: -5755.344202651551
[206/1000] max fitness: -5755.344202651551
[207/1000] max fitness: -5755.344202651551
[208/1000] max fitness: -5755.344202651551
[209/1000] max fitness: -5755.344202651551
[210/1000] max fitness: -5755.344202651551
[211/1000] max fitness: -5755.344202651551
[212/1000] max fitness: -5755.344202651551
[213/1000] max fitness: -5755.344202651551
[214/1000] max fitness: -5755.344202651551
[215/1000] max fitness: -5755.344202651551
[216/1000] max fitness: -5755.344202651551
[217/1000] max fitness: -5755.344202651551
[218/1000] max fitness: -5755.344202651551
[219/1000] max fitness: -5755.344202651551
[220/1000] max fitness: -5755.344202651551
[221/1000] max fitness: -5755.344202651551
[222/1000] max fitness: -5755.344202651551
[223/1000] max fitness: -5755.344202651551
[224/1000] max fitness: -5755.344202651551
[225/1000] max fitness: -5755.344202651551
[226/1000] max fitness: -5755.344202651551
[227/1000] max fitness: -5755.344202651551
[228/1000] max fitness: -5755.344202651551
[229/1000] max fitness: -5755.344202651551
[230/1000] max fitness: -5755.344202651551
[231/1000] max fitness: -5755.344202651551
[232/1000] max fitness: -5755.344202651551
[233/1000] max fitness: -5755.344202651551
[234/1000] max fitness: -5755.344202651551
[235/1000] max fitness: -5755.344202651551
[236/1000] max fitness: -5755.344202651551
[237/1000] max fitness: -5755.344202651551
[238/1000] max fitness: -5755.344202651551
[239/1000] max fitness: -5755.344202651551
[240/1000] max fitness: -5755.344202651551
[241/1000] max fitness: -5755.344202651551
[242/1000] max fitness: -5755.344202651551
[243/1000] max fitness: -5755.344202651551
[244/1000] max fitness: -5755.344202651551
[245/1000] max fitness: -5755.344202651551
[246/1000] max fitness: -5755.344202651551
[247/1000] max fitness: -5755.344202651551
[248/1000] max fitness: -5755.344202651551
[249/1000] max fitness: -5755.344202651551
[250/1000] max fitness: -5755.344202651551
[251/1000] max fitness: -5755.344202651551
[252/1000] max fitness: -5755.344202651551
[253/1000] max fitness: -5755.344202651551
[254/1000] max fitness: -3448.2535886942387
[255/1000] max fitness: -3448.2535886942387
[256/1000] max fitness: -3448.2535886942387
[257/1000] max fitness: -3448.2535886942387
[258/1000] max fitness: -3448.2535886942387
[259/1000] max fitness: -3448.2535886942387
[260/1000] max fitness: -1.0000000000000018
[261/1000] max fitness: -1.0000000000000018
[262/1000] max fitness: -1.0000000000000018
[263/1000] max fitness: -1.0000000000000018
[264/1000] max fitness: -1.0000000000000018
[265/1000] max fitness: -1.0000000000000018
[266/1000] max fitness: -1.0000000000000018
[267/1000] max fitness: -1.0000000000000018
[268/1000] max fitness: -1.0000000000000018
[269/1000] max fitness: -1.0000000000000018
[270/1000] max fitness: -1.0000000000000018
[271/1000] max fitness: -1.0000000000000018
[272/1000] max fitness: -1.0000000000000018
[273/1000] max fitness: -1.0000000000000018
[274/1000] max fitness: -1.0000000000000018
[275/1000] max fitness: -1.0000000000000018
[276/1000] max fitness: -1.0000000000000018
[277/1000] max fitness: -1.0000000000000018
[278/1000] max fitness: -1.0000000000000018
[279/1000] max fitness: -1.0000000000000018
[280/1000] max fitness: -1.0000000000000018
[281/1000] max fitness: -1.0000000000000018
[282/1000] max fitness: -1.0000000000000018
[283/1000] max fitness: -1.0000000000000018
[284/1000] max fitness: -1.0000000000000018
[285/1000] max fitness: -1.0000000000000018
[286/1000] max fitness: -1.0000000000000018
[287/1000] max fitness: -1.0000000000000018
[288/1000] max fitness: -1.0000000000000018
[289/1000] max fitness: -1.0000000000000018
[290/1000] max fitness: -1.0000000000000018
[291/1000] max fitness: -1.0
[292/1000] max fitness: -1.0
[293/1000] max fitness: -1.0
[294/1000] max fitness: -1.0
[295/1000] max fitness: -1.0
[296/1000] max fitness: -1.0
[297/1000] max fitness: -1.0
[298/1000] max fitness: -1.0
[299/1000] max fitness: -1.0
[300/1000] max fitness: -1.0
[301/1000] max fitness: -1.0
[302/1000] max fitness: -1.0
[303/1000] max fitness: -1.0
[304/1000] max fitness: -1.0
[305/1000] max fitness: -1.0
[306/1000] max fitness: -1.0
[307/1000] max fitness: -1.0
[308/1000] max fitness: -1.0
[309/1000] max fitness: -1.0
[310/1000] max fitness: -1.0
[311/1000] max fitness: -1.0
[312/1000] max fitness: -1.0
[313/1000] max fitness: -1.0
[314/1000] max fitness: -1.0
[315/1000] max fitness: -1.0
[316/1000] max fitness: -1.0
[317/1000] max fitness: -1.0
[318/1000] max fitness: -1.0
[319/1000] max fitness: -1.0
[320/1000] max fitness: -1.0
[321/1000] max fitness: -1.0
[322/1000] max fitness: -1.0
[323/1000] max fitness: -1.0
[324/1000] max fitness: -1.0
[325/1000] max fitness: -1.0
[326/1000] max fitness: -1.0
[327/1000] max fitness: -1.0
[328/1000] max fitness: -1.0
[329/1000] max fitness: -1.0
[330/1000] max fitness: -1.0
[331/1000] max fitness: -1.0
[332/1000] max fitness: -1.0
[333/1000] max fitness: -1.0
[334/1000] max fitness: -1.0
[335/1000] max fitness: -1.0
[336/1000] max fitness: -1.0
[337/1000] max fitness: -1.0
[338/1000] max fitness: -1.0
[339/1000] max fitness: -1.0
[340/1000] max fitness: -1.0
[341/1000] max fitness: -1.0
[342/1000] max fitness: -1.0
[343/1000] max fitness: -1.0
[344/1000] max fitness: -1.0
[345/1000] max fitness: -1.0
[346/1000] max fitness: -1.0
[347/1000] max fitness: -1.0
[348/1000] max fitness: -1.0
[349/1000] max fitness: -1.0
[350/1000] max fitness: -1.0
[351/1000] max fitness: -1.0
[352/1000] max fitness: -1.0
[353/1000] max fitness: -1.0
[354/1000] max fitness: -1.0
[355/1000] max fitness: -1.0
[356/1000] max fitness: -1.0
[357/1000] max fitness: -1.0
[358/1000] max fitness: -1.0
[359/1000] max fitness: -1.0
[360/1000] max fitness: -1.0
[361/1000] max fitness: -1.0
[362/1000] max fitness: -1.0
[363/1000] max fitness: -1.0
[364/1000] max fitness: -1.0
[365/1000] max fitness: -1.0
[366/1000] max fitness: -1.0
[367/1000] max fitness: -1.0
[368/1000] max fitness: -1.0
[369/1000] max fitness: -1.0
[370/1000] max fitness: -1.0
[371/1000] max fitness: -1.0
[372/1000] max fitness: -1.0
[373/1000] max fitness: -1.0
[374/1000] max fitness: -1.0
[375/1000] max fitness: -1.0
[376/1000] max fitness: -1.0
[377/1000] max fitness: -1.0
[378/1000] max fitness: -1.0
[379/1000] max fitness: -1.0
[380/1000] max fitness: -1.0
[381/1000] max fitness: -1.0
[382/1000] max fitness: -1.0
[383/1000] max fitness: -1.0
[384/1000] max fitness: -1.0
[385/1000] max fitness: -1.0
[386/1000] max fitness: -1.0
[387/1000] max fitness: -1.0
[388/1000] max fitness: -1.0
[389/1000] max fitness: -1.0
[390/1000] max fitness: -1.0
[391/1000] max fitness: -1.0
[392/1000] max fitness: -1.0
[393/1000] max fitness: -1.0
[394/1000] max fitness: -1.0
[395/1000] max fitness: -1.0
[396/1000] max fitness: -1.0
[397/1000] max fitness: -1.0
[398/1000] max fitness: -1.0
[399/1000] max fitness: -1.0
[400/1000] max fitness: -1.0
[401/1000] max fitness: -1.0
[402/1000] max fitness: -1.0
[403/1000] max fitness: -1.0
[404/1000] max fitness: -1.0
[405/1000] max fitness: -1.0
[406/1000] max fitness: -1.0
[407/1000] max fitness: -1.0
[408/1000] max fitness: -1.0
[409/1000] max fitness: -1.0
[410/1000] max fitness: -1.0
[411/1000] max fitness: -1.0
[412/1000] max fitness: -1.0
[413/1000] max fitness: -1.0
[414/1000] max fitness: -1.0
[415/1000] max fitness: -1.0
[416/1000] max fitness: -1.0
[417/1000] max fitness: -1.0
[418/1000] max fitness: -1.0
[419/1000] max fitness: -1.0
[420/1000] max fitness: -1.0
[421/1000] max fitness: -1.0
[422/1000] max fitness: -1.0
[423/1000] max fitness: -1.0
[424/1000] max fitness: -1.0
[425/1000] max fitness: -1.0
[426/1000] max fitness: -1.0
[427/1000] max fitness: -1.0
[428/1000] max fitness: -1.0
[429/1000] max fitness: -1.0
[430/1000] max fitness: -1.0
[431/1000] max fitness: -1.0
[432/1000] max fitness: -1.0
[433/1000] max fitness: -1.0
[434/1000] max fitness: -1.0
[435/1000] max fitness: -1.0
[436/1000] max fitness: -1.0
[437/1000] max fitness: -1.0
[438/1000] max fitness: -1.0
[439/1000] max fitness: -1.0
[440/1000] max fitness: -1.0
[441/1000] max fitness: -1.0
[442/1000] max fitness: -1.0
[443/1000] max fitness: -1.0
[444/1000] max fitness: -1.0
[445/1000] max fitness: -1.0
[446/1000] max fitness: -1.0
[447/1000] max fitness: -1.0
[448/1000] max fitness: -1.0
[449/1000] max fitness: -1.0
[450/1000] max fitness: -1.0
[451/1000] max fitness: -1.0
[452/1000] max fitness: -1.0
[453/1000] max fitness: -1.0
[454/1000] max fitness: -1.0
[455/1000] max fitness: -1.0
[456/1000] max fitness: -1.0
[457/1000] max fitness: -1.0
[458/1000] max fitness: -1.0
[459/1000] max fitness: -1.0
[460/1000] max fitness: -1.0
[461/1000] max fitness: -1.0
[462/1000] max fitness: -1.0
[463/1000] max fitness: -1.0
[464/1000] max fitness: -1.0
[465/1000] max fitness: -1.0
[466/1000] max fitness: -1.0
[467/1000] max fitness: -1.0
[468/1000] max fitness: -1.0
[469/1000] max fitness: -1.0
[470/1000] max fitness: -1.0
[471/1000] max fitness: -1.0
[472/1000] max fitness: -1.0
[473/1000] max fitness: -1.0
[474/1000] max fitness: -1.0
[475/1000] max fitness: -1.0
[476/1000] max fitness: -1.0
[477/1000] max fitness: -1.0
[478/1000] max fitness: -1.0
[479/1000] max fitness: -1.0
[480/1000] max fitness: -1.0
[481/1000] max fitness: -1.0
[482/1000] max fitness: -1.0
[483/1000] max fitness: -1.0
[484/1000] max fitness: -1.0
[485/1000] max fitness: -1.0
[486/1000] max fitness: -1.0
[487/1000] max fitness: -1.0
[488/1000] max fitness: -1.0
[489/1000] max fitness: -1.0
[490/1000] max fitness: -1.0
[491/1000] max fitness: -1.0
[492/1000] max fitness: -1.0
[493/1000] max fitness: -1.0
[494/1000] max fitness: -1.0
[495/1000] max fitness: -1.0
[496/1000] max fitness: -1.0
[497/1000] max fitness: -1.0
[498/1000] max fitness: -1.0
[499/1000] max fitness: -1.0
[500/1000] max fitness: -1.0
[501/1000] max fitness: -1.0
[502/1000] max fitness: -1.0
[503/1000] max fitness: -1.0
[504/1000] max fitness: -1.0
[505/1000] max fitness: -1.0
[506/1000] max fitness: -1.0
[507/1000] max fitness: -1.0
[508/1000] max fitness: -1.0
[509/1000] max fitness: -1.0
[510/1000] max fitness: -1.0
[511/1000] max fitness: -1.0
[512/1000] max fitness: -1.0
[513/1000] max fitness: -1.0
[514/1000] max fitness: -1.0
[515/1000] max fitness: -1.0
[516/1000] max fitness: -1.0
[517/1000] max fitness: -1.0
[518/1000] max fitness: -1.0
[519/1000] max fitness: -1.0
[520/1000] max fitness: -1.0
[521/1000] max fitness: -1.0
[522/1000] max fitness: -1.0
[523/1000] max fitness: -1.0
[524/1000] max fitness: -1.0
[525/1000] max fitness: -1.0
[526/1000] max fitness: -1.0
[527/1000] max fitness: -1.0
[528/1000] max fitness: -1.0
[529/1000] max fitness: -1.0
[530/1000] max fitness: -1.0
[531/1000] max fitness: -1.0
[532/1000] max fitness: -1.0
[533/1000] max fitness: -1.0
[534/1000] max fitness: -1.0
[535/1000] max fitness: -1.0
[536/1000] max fitness: -1.0
[537/1000] max fitness: -1.0
[538/1000] max fitness: -1.0
[539/1000] max fitness: -1.0
[540/1000] max fitness: -1.0
[541/1000] max fitness: -1.0
[542/1000] max fitness: -1.0
[543/1000] max fitness: -1.0
[544/1000] max fitness: -1.0
[545/1000] max fitness: -1.0
[546/1000] max fitness: -1.0
[547/1000] max fitness: -1.0
[548/1000] max fitness: -1.0
[549/1000] max fitness: -1.0
[550/1000] max fitness: -1.0
[551/1000] max fitness: -1.0
[552/1000] max fitness: -1.0
[553/1000] max fitness: -1.0
[554/1000] max fitness: -1.0
[555/1000] max fitness: -1.0
[556/1000] max fitness: -1.0
[557/1000] max fitness: -1.0
[558/1000] max fitness: -1.0
[559/1000] max fitness: -1.0
[560/1000] max fitness: -1.0
[561/1000] max fitness: -1.0
[562/1000] max fitness: -1.0
[563/1000] max fitness: -1.0
[564/1000] max fitness: -1.0
[565/1000] max fitness: -1.0
[566/1000] max fitness: -1.0
[567/1000] max fitness: -1.0
[568/1000] max fitness: -1.0
[569/1000] max fitness: -1.0
[570/1000] max fitness: -1.0
[571/1000] max fitness: -1.0
[572/1000] max fitness: -1.0
[573/1000] max fitness: -1.0
[574/1000] max fitness: -1.0
[575/1000] max fitness: -1.0
[576/1000] max fitness: -1.0
[577/1000] max fitness: -1.0
[578/1000] max fitness: -1.0
[579/1000] max fitness: -1.0
[580/1000] max fitness: -1.0
[581/1000] max fitness: -1.0
[582/1000] max fitness: -1.0
[583/1000] max fitness: -1.0
[584/1000] max fitness: -1.0
[585/1000] max fitness: -1.0
[586/1000] max fitness: -1.0
[587/1000] max fitness: -1.0
[588/1000] max fitness: -1.0
[589/1000] max fitness: -1.0
[590/1000] max fitness: -1.0
[591/1000] max fitness: -1.0
[592/1000] max fitness: -1.0
[593/1000] max fitness: -1.0
[594/1000] max fitness: -1.0
[595/1000] max fitness: -1.0
[596/1000] max fitness: -1.0
[597/1000] max fitness: -1.0
[598/1000] max fitness: -1.0
[599/1000] max fitness: -1.0
[600/1000] max fitness: -1.0
[601/1000] max fitness: -1.0
[602/1000] max fitness: -1.0
[603/1000] max fitness: -1.0
[604/1000] max fitness: -1.0
[605/1000] max fitness: -1.0
[606/1000] max fitness: -1.0
[607/1000] max fitness: -1.0
[608/1000] max fitness: -1.0
[609/1000] max fitness: -1.0
[610/1000] max fitness: -1.0
[611/1000] max fitness: -1.0
[612/1000] max fitness: -1.0
[613/1000] max fitness: -1.0
[614/1000] max fitness: -1.0
[615/1000] max fitness: -1.0
[616/1000] max fitness: -1.0
[617/1000] max fitness: -1.0
[618/1000] max fitness: -1.0
[619/1000] max fitness: -1.0
[620/1000] max fitness: -1.0
[621/1000] max fitness: -1.0
[622/1000] max fitness: -1.0
[623/1000] max fitness: -1.101514265906959e-32

Total running time of the script: ( 0 minutes 39.584 seconds)

Gallery generated by Sphinx-Gallery