How to make a regression neural network in Python?

How can I implement a regression neural network in Python? I recently started studying neural networks, and I ran into a problem. I made the simplest Snake game in Python. How can I make a neural network that will control the snake? That is, give it the coordinates of the snake, the coordinates of the apple by X, and get the direction of movement of the snake, for example, 0-to the left, 1-to the right. Accordingly, also for the Y coordinate.

Author: Константин, 2020-07-23

1 answers

This is called a neural network with reinforcement.First, the usual black-and-white pictures will learn to recognize their own logical operations there, then to a more complex one.Encode the commands A-left=0.01, B-right=0.02, C,D(up, down), first randomly in the cycle go, then success 1 (getting points) and 0.Then it should generate commands, I think the architecture is like 4 inputs, 5 outputs(1 for success/no).That is, when the minimum error is reached, it must somehow generate commands.I think so)

 0
Author: Константин, 2020-07-25 05:22:16