CodeReclaimers / neat-python

Python implementation of the NEAT neuroevolution algorithm
BSD 3-Clause "New" or "Revised" License
1.41k stars 490 forks source link

Are there anyway to convert a genome to neural network? #198

Closed taepatipol closed 4 years ago

taepatipol commented 4 years ago

Are there anyway to convert a single genome (the winner genome from population.run that I pickled) to neural network? So I can use the winner neural network for another data.

taepatipol commented 4 years ago

I have founded the solution.

file = open('winner.pkl','rb')
genome = pickle.load(file)
file.close()

config = neat.Config(neat.DefaultGenome, neat.DefaultReproduction,
                     neat.DefaultSpeciesSet, neat.DefaultStagnation,
                     'config-feedforward')
net = neat.nn.recurrent.RecurrentNetwork.create(genome, config)