50a48e6cdd5f2240d2f0c793b3b3991d09c28d03,genome_handler.py,GenomeHandler,mutate,#GenomeHandler#Any#,53

Before Change


        self.dense_layer_size = len(self.dense_layer_shape)

    def mutate(self, genome):
        while True:
            index = np.random.choice(range(1, len(genome)))
            if index < self.convolution_layer_size * self.convolution_layers:
                if genome[index - index % self.convolution_layer_size]:
                    range_index = index % self.convolution_layer_size
                    choice_range = self.convolutional_layer_shape[range_index]
                    genome[index] = np.random.choice(choice_range)
                    break
            elif index != len(genome) - 1:
                offset = self.convolution_layer_size * self.convolution_layers
                new_index = (index - offset)
                present_index = new_index - new_index % self.dense_layer_size
                if genome[present_index + offset]:
                    range_index = new_index % self.dense_layer_size
                    choice_range = self.dense_layer_shape[range_index]
                    genome[index] = np.random.choice(choice_range)
                    break
            else:
                genome[index] = np.random.choice(self.optimizer.keys())
                break
        return genome

    def decode(self, genome):
        model = Sequential()

After Change


        self.dense_layer_size = len(self.dense_layer_shape)

    def mutate(self, genome):
        num_mutations = np.random.choice(range(3))
        for i in range(num_mutations):
            index = np.random.choice(range(1, len(genome)))
            if index < self.convolution_layer_size * self.convolution_layers:
                if genome[index - index % self.convolution_layer_size]:
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: joeddav/devol
Commit Name: 50a48e6cdd5f2240d2f0c793b3b3991d09c28d03
Time: 2017-03-25
Author: easton.huch@gmail.com
File Name: genome_handler.py
Class Name: GenomeHandler
Method Name: mutate


Project Name: facebookresearch/ParlAI
Commit Name: 6726e87d0be42635408e5c7594cbb5d5c0d7a36a
Time: 2019-11-25
Author: jase@fb.com
File Name: parlai/tasks/convai2/worlds.py
Class Name: InteractiveWorld
Method Name: get_new_personas


Project Name: SpiNNakerManchester/sPyNNaker
Commit Name: 070003f70129fd8dd88364df6d2ae64c1d2a35f8
Time: 2017-11-24
Author: andrew.gait@manchester.ac.uk
File Name: spynnaker/pyNN/models/neural_projections/connectors/fixed_number_post_connector.py
Class Name: FixedNumberPostConnector
Method Name: _get_post_neurons