f76b988862e07b4dcfae78ff8fa98e2e77fc7f1d,examples/nd_example.py,,main,#,51

Before Change


def main():
    pop_size = 100
    loop = toolz.iterate(toolz.compose(algorithm.evolve, update_fitness), MyNDTree.create_population(pop_size))
    populations = list(toolz.take(10, loop))
    best = selBest(populations[-1], 1)[0]
    print(best)


if __name__ == "__main__":

After Change


    mutate = partial(nd_mutation, mut1d=mutuniform(pset=pset))
    mate = partial(nd_crossover, cx1d=cxonepoint())

    algorithm = AgeFitness(mate, mutate, selNSGA2, MyNDTree.create_population)

    pop = update_fitness(MyNDTree.create_population(pop_size))

    for gen in range(20):
        pop = algorithm.evolve(pop)
        pop = update_fitness(pop)
        best = selBest(pop, 1)[0]
        print(best, best.fitness.values)


if __name__ == "__main__":
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: Ambrosys/glyph
Commit Name: f76b988862e07b4dcfae78ff8fa98e2e77fc7f1d
Time: 2017-03-21
Author: mquade@uni-potsdam.de
File Name: examples/nd_example.py
Class Name:
Method Name: main


Project Name: keras-team/autokeras
Commit Name: 907b13fb8b8d169256d930e1cb01a5f7b31d5430
Time: 2020-02-12
Author: jhfjhfj1@gmail.com
File Name: autokeras/adapters/output_adapter.py
Class Name: ClassificationHeadAdapter
Method Name: fit_before_convert