Neural Network and Qlearning. Survival agents.

My first experience with neural network and q-learning.
In next step I want to add genetic algorithm and expand world, and sure to add enemies.
;D

6HILhAcwXLE

This seems pretty cool based on the description…

but can you give a bit more information for what’s going on in the video?

So. agents, that you can see on the field have brain (neural network), witch learning to eat (red points on the field). If agent’s brain not enough “smart” he can’t eat enough and he finally die, because food influence on their health.
As you can see on beginning of the video agents not understood what’s going on too. And after a while they start to try eat.

In other words it is demonstration of Artificial Intelligence based on neural network and q-learning.

Looks very nice.

What kind of problem your AI solvs, pathfinding to neighbouring food or decision making?
The latter would be very interesting.
For example agent may have to take decision whether stay close to local food, which is shrinking or to go to larger food somewhere around, taking the risk that other agents may do the same.

br

On this video agents know about the nearest food and “feel smell of it”. In this way neural network is encouraged more if agent near the food and less if agent going away from it. Your idea is interesting, I want to add limited vision area to agents, they can see all the field at the moment.

Thanks for explanation.

What is the difference between green and yellow agents?
Can you give some details about your neural network?

Green color of agents means that they just ate and their health is about 80-100%. Yellow means, that health is less 80%.
Agent has 5 choices of action (move straight, move and turn right on 15 degrees, move and turn left on 15 degrees, stay and turn left, stay and turn right).
Every action is outer of neural network. On neural network’s enters sends signals of the world. There are 5 signals (is the food in view field, distance between food and agent, angle, health, speed).
This is my new video.
The blue agent is “the best eater”

6HILhAcwXLE

Thanks for the new movie.

It would be interesting to compare your solution with other artificial intelligence techniques, some kind of benchmark.
You may also introduce more complexity to the problem, something which is very difficult to obtain by minimisation solutions.
For example by adding different “sizes” of food, acceleration of agents or interaction with other agents.

Is your network a multilayer perceptron? How do you deal with local minimum problem?

Yeah, there is a lot of work to be done with this project: enemies, genetic algorithm for reproduction, saving weights, extend world, your idea with food is interesting and maybe to add extra actions to agents.
But because of my study and I’m one who do this, progress is slow.
Yes, it is multi-layer perceptron and outer is Q-function.
Actually, I didn’t solve local minimum problem yet, but some result I’ve got when I tune the alpha from 0.1 to 0.0001, but it still there is. So this is one more think to work on it in the future :slight_smile:

This is really cool.

It would be interesting if there were also predators (some kind of food-draining vampire, so they could learn instead of just dying) and they had to learn to seek food while avoiding enemies (who would have to learn to hunt them).

This is quite and interesting things you’re working on.

Thank you :slight_smile:

Really nice work:)

Once I was thinking to make a soccer game where each soccer player was controlled by a neural network brain.
The player has to make a decision about an action, run, pass a ball, defend, wait for a ball and so on. Depending on the other players positions, a distance to a ball, a threat of goal.

I will come back to that project and wish you luck in yours.

One more question, did you use some NN library or did you write your own

Really there are many interesting “scenarios” for neural network. Share your project when it will be ready :slight_smile:
No I didn’t use the library, all from books

Good exercise to write everything by yourself.
It helps better understanding of the topic.

I did it also, but I wrote my NN library in C++. In addition I wanted to introduce parallel computing by using mpi.
It can be easy by using scalapack for matrix operations and so on. However, bottlenets are not matrix operations but a training process itself which is an iteration process. So, I found it very difficult to do it in parallel.