Beispiel #1
0
 def get(self):
     index = self.context['experiment']['index'] - 1
     index %= len(self.population)
     origin = self.population[index]
     dna = DNASequence()
     dna.fromstring(origin['dna'])
     mutate(dna, self.data['mutations'])
     return dna
Beispiel #2
0
def decompile(network: NeuralNetwork):
    dna = DNASequence()
    for layer in network.layers:
        _create_layer(dna, network, layer)

    return dna