class_docstr: Defines the configuration and handles the conversion and mutation of
  individual genomes. Should be created and passed to a `DEvol` instance.
  
  ---
  Genomes are represented as fixed-with lists of integers corresponding
  to sequential layers and properties. A model with 2 convolutional layers
  and 1 dense layer would look like:
  
  [<conv layer><conv layer><dense layer><optimizer>]
  
  The makeup of the convolutional layers and dense layers is defined in the
  GenomeHandler below under self.convolutional_layer_shape and
  self.dense_layer_shape. <optimizer> consists of just one property.
class_docstr_tok: ["Defines","the","configuration","and","handles","the","conversion","and","mutation","of","individual","genomes",".","Should","be","created","and","passed","to","a","`","DEvol","`","instance",".","--","-","Genomes","are","represented","as","fixed-with","lists","of","integers","corresponding","to","sequential","layers","and","properties",".","A","model","with","2","convolutional","layers","and","1","dense","layer","would","look","like",":","[","<","conv","layer",">","<","conv","layer",">","<","dense","layer",">","<","optimizer",">","]","The","makeup","of","the","convolutional","layers","and","dense","layers","is","defined","in","the","GenomeHandler","below","under","self.convolutional_layer_shape","and","self.dense_layer_shape",".","<","optimizer",">","consists","of","just","one","property","."]
code: def mutate(self, genome, num_mutations):
      num_mutations = np.random.choice(num_mutations)
      for i in range(num_mutations):
          index = np.random.choice(list(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.convParam(range_index)
                  genome[index] = np.random.choice(choice_range)
              elif (
                  rand.uniform(0, 1) <= 0.01
              ):  # randomly flip deactivated layers
                  genome[
                      index - index % self.convolution_layer_size
                  ] = 1
          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.denseParam(range_index)
                  genome[index] = np.random.choice(choice_range)
              elif rand.uniform(0, 1) <= 0.01:
                  genome[present_index + offset] = 1
          else:
              genome[index] = np.random.choice(
                  list(range(len(self.optimizer)))
              )
      return genome
  
file_path: devol/devol/genome_handler.py
imports: import numpy
  import random
  import math
  from keras.models import Sequential
  from keras.layers import Activation, Dense, Dropout, Flatten
  from keras.layers.convolutional import Convolution2D, MaxPooling2D
  from keras.layers.normalization import BatchNormalization
label_desc: Use image node_id 4 for calling the GenomeHandler obj's underlying member method code with example usage: obj.mutate(genome, num_mutations) and returns: genome