V
V
Vitaly Stolyarov2017-10-14 12:52:32
Neural networks
Vitaly Stolyarov, 2017-10-14 12:52:32

How to start training a bot on a neural network?

I looked at many examples with neural networks, but they were quite simple examples, so for the current task - to teach a bot to play football - there is no clear idea what input parameters are needed for this.
The game model is very simple: a field, two teams of 3 people. and one ball, each object of which is a circle with a certain radius and mass.
Each object has such controlled parameters as acceleration and direction (with the exception of the ball, it moves under the influence of external objects)
Each player can know about the ball, teammates and opponents.
Stupid bots in a couple of lines can only move straight to the ball. There was an attempt to add different behavior using conditional statements, for example:
if the defender, do not go far from the goal
if attackers, stay in the middle of the field if there are already two teammates at our goal
if the ball rolls towards our goal, beat it from the side and knock it out.
This behavior is already better, but then everything only gets more complicated when you try to add new behaviors so as not to break the previous ones.
As for neural networks, as already mentioned, it finds only simple examples, where it is obvious what parameters are needed. And for such a bot what?
At the exit, you only need to know in which direction to move and with what acceleration
At the input, you can get: your position, the position and direction of the ball, the position of teammates and opponents (accordingly, the following data can be distinguished from this: the angle of direction to the ball, the number of teammates and opponents nearby in a certain radius, teammates or opponents leading the ball
) submit to the net so that there is no attachment to a certain position on the field, and have different behaviors for the defender / attacker (should it be divided into two networks?)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
�
âš¡ Kotobotov âš¡, 2017-10-14
@Ni55aN

you must understand why you need to use a neural network.
It’s better for you to go in from the very beginning, who to train, how to train, and so on.
for example, simplify the task to training a "football player" as an "autonomous agent", based on a state machine that has a state (of the environment and itself) and has actions - and you try different combinations of these states and actions.
For example, you can describe the state of a football player as the location of the ball (right-left in front, front-right, front left, etc.) - you associate a separate action with this state (moving to the right, left, etc.), you can additionally compare, for example, the distance to the ball.
e.g. ball top-left distance 10 cells -> agent action -> moves straight ahead
ball right left distance 2 cells -> agent action -> move left.
as a result, you get recorded mappings to states and actions.
in order to teach optimal behavior, you need to introduce a function of evaluating the result after the actions, reward (remember) the actions that lead to an increase in the result, and refuse actions that reduce the result.
the result can be, for example, 1 / "distance to the sword"
at the beginning you start the agent with random iterations of interactions between states and actions. Then, more or less trained to move, you start playing against each other, for example, in football, and so on.
you add to the result an assessment of the result of the match, and so on.
you can use a genetic algorithm to more quickly find the optimal parameters of the finite state machine, you can then try to fasten the neural network. You can draw some conclusions based on the statistics you have prepared (but, as I understand it, you don’t have any statistics, so you still have to train the bot by playing against each other and sort through random options).

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question