seallard / walker

NEAT
MIT License
0 stars 0 forks source link

OverflowError #74

Closed seallard closed 3 years ago

seallard commented 3 years ago

The sum of incoming signals gets too big causing an overflow. The node.sum was -160.064 when the overflow below occurred. The values of the observations are (-inf, inf), probably need to squash them.

math range error
  File "/home/seal/walker/neat/node.py", line 43, in sigmoid
    return 1 / (1 + exp(-4.9*self.sum)) # Coefficient from original NEAT src.
  File "/home/seal/walker/neat/node.py", line 21, in activate
    self.output = self.sigmoid()
  File "/home/seal/walker/neat/network.py", line 45, in activate
    node.activate()
  File "/home/seal/walker/experiments/cheetah.py", line 23, in evaluate
    action = network.activate(observation, stabilize=False)
  File "/home/seal/walker/neat/genetic_algorithm.py", line 17, in run
    fitness, done = self.environment.evaluate(genome)
  File "/home/seal/walker/experiments/cheetah.py", line 33, in <module>
    ga.run()
seallard commented 3 years ago

https://stackoverflow.com/questions/21030391/how-to-normalize-an-array-in-numpy