change a lot
This commit is contained in:
@@ -2,15 +2,16 @@ import jax
|
||||
|
||||
from algorithm.config import Configer
|
||||
from algorithm.neat import NEAT
|
||||
from algorithm.neat.genome import create_mutate
|
||||
|
||||
if __name__ == '__main__':
|
||||
config = Configer.load_config()
|
||||
neat = NEAT(config)
|
||||
randkey = jax.random.PRNGKey(42)
|
||||
state = neat.setup(randkey)
|
||||
mutate_func = jax.jit(create_mutate(config, neat.gene_type))
|
||||
state = mutate_func(state)
|
||||
state = neat.mutate(state)
|
||||
print(state)
|
||||
pop_nodes, pop_conns = state.pop_nodes, state.pop_conns
|
||||
print(neat.distance(state, pop_nodes[0], pop_conns[0], pop_nodes[1], pop_conns[1]))
|
||||
print(neat.crossover(state, pop_nodes[0], pop_conns[0], pop_nodes[1], pop_conns[1]))
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user