5958912a9107ad7423ce1395aa84a467f16e3eb6,chemml/search/genetic_algorithm.py,GeneticAlgorithm,search,#GeneticAlgorithm#,224

Before Change


                st_time = time.time()
                cross_pop, mutant_pop = [], []
                // Generate crossover population
                c_total = self.RouletteWheelSelection(fitness_dict, math.ceil(self.crossover_size*len(pop)))
                combi = list(itertools.combinations(list(set(c_total)), 2))
                co_pop = []
                for i, j in zip(list(set(c_total))[::2], list(set(c_total))[1::2]):
                    co_pop.append((i, j))
                c_rem = [i for i in combi if i not in co_pop]
                diff = math.ceil(self.crossover_size*len(pop)/2) - len(co_pop)
                if diff>0: co_pop += c_rem[:diff]
                for child1, child2 in co_pop:

After Change


                st_time = time.time()
                cross_pop, mutant_pop = [], []
                // Generate crossover population
                c_total = self.RouletteWheelSelection(fitness_dict, int(math.ceil(self.crossover_size*len(pop))))
                combi = list(itertools.combinations(list(set(c_total)), 2))
                co_pop = []
                for i, j in zip(list(set(c_total))[::2], list(set(c_total))[1::2]):
                    co_pop.append((i, j))
                c_rem = [i for i in combi if i not in co_pop]
                diff = int(math.ceil(self.crossover_size*len(pop)/2)) - len(co_pop)
                if diff>0: co_pop += c_rem[:diff]
                for child1, child2 in co_pop:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 3

Instances


Project Name: hachmannlab/chemml
Commit Name: 5958912a9107ad7423ce1395aa84a467f16e3eb6
Time: 2019-01-25
Author: mojtabah@buffalo.edu
File Name: chemml/search/genetic_algorithm.py
Class Name: GeneticAlgorithm
Method Name: search


Project Name: LCAV/pyroomacoustics
Commit Name: cb3464e08385c2f6610483b8ea2553242b3a0fc9
Time: 2017-07-16
Author: fakufaku@gmail.com
File Name: pyroomacoustics/beamforming.py
Class Name:
Method Name: spiral_2D_array


Project Name: google/unrestricted-adversarial-examples
Commit Name: f5248ea6ad2f44f7fa058d43a6c7cc62bf9edaa1
Time: 2018-09-19
Author: nottombrown@gmail.com
File Name: unrestricted-advex/unrestricted_advex/mnist_baselines/mnist_utils.py
Class Name:
Method Name: two_class_iter


Project Name: bearpaw/pytorch-pose
Commit Name: 6f1966e70eb75f8c3f15943f770c7a5780e2373b
Time: 2017-08-01
Author: platero.yang@gmail.com
File Name: pose/utils/imutils.py
Class Name:
Method Name: sample_with_heatmap