We are gonna train the neural network that will allow us to keep the snake to stay alive.Essentially the output will be what direction to go in or to follow the certain direction or not. Essentially we just wanna keep the snake alive.
The first step is to decide what the input is gonna be and to decide what the output is gonna be.
For this case, the input can be, do we have anything in front of the snake and do we have anything to the left of the snake and do we have anything to the right of the snake?. We are those by 0 and 1.
And the last input will be recommended direction for the snake. The recommended direction can be anything. So for this case, let’s take recommended direction to be left. The output will be whether we have to follow the recommended direction or not.
The output in this case should be 0 or 1 representing to follow the recommended direction or not. So, the output will be 1 as we can follow the recommended direction.
Now, when we change the recommended direction to be right then we are gonna crash into our tail which means that we should not follow that direction. So, our output should be 0.( as 1 for true and 0 for false)
Post a Comment
Post a Comment