CodeReclaimers / neat-python

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

Making an ai with multiple outputs. #204

Closed penneShells closed 4 years ago

penneShells commented 4 years ago

I am trying to make a tetris ai, but dont quite understand how to make it so that the outputs differenciate between moving left, right, down, etc. How do i make it so that depending on what the inputs come to, the ai does a different move?

nurettin commented 4 years ago

@Jaccccc Tetris can be played with three arrows. So your outputs will be:

o1: left arrow (between 0 and 1) o2: up arrow (between 0 and 1) o3: right arrow (between 0 and 1)

Now the neural network controls your keys. If your output is greater than a certain threshold, you make it press the key.

penneShells commented 4 years ago

Thanks for the help, its a lot easier to visualize the neural nets and outputs now!