Hi !
Featured games (91)
games approved by the League of Dukes
Games in Showcase (808)
Games in Android Showcase (239)
games submitted by our members
Games in WIP (872)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Neural Network and Qlearning. Survival agents.  (Read 22850 times)
0 Members and 1 Guest are viewing this topic.
Offline UnuntuMDJ
« Posted 2017-03-27 16:09:20 »

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.
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
Offline bmanmcfly
« Reply #1 - Posted 2017-03-28 18:19:25 »

This seems pretty cool based on the description...

but can you give a bit more information for what's going on in the video?
Offline UnuntuMDJ
« Reply #2 - Posted 2017-03-29 10:31:47 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline meva
« Reply #3 - Posted 2017-04-06 09:57:10 »

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.

Offline UnuntuMDJ
« Reply #4 - Posted 2017-04-07 05:55:25 »

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.
Offline meva
« Reply #5 - Posted 2017-04-12 14:05:53 »

Thanks for explanation.

What is the difference between green and yellow agents?
Can you give some details about your neural network?
Offline UnuntuMDJ
« Reply #6 - Posted 2017-04-13 08:21:30 »

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"
<a href=";hl=en_US&amp;start=" target="_blank">;hl=en_US&amp;start=</a>
Offline meva
« Reply #7 - Posted 2017-04-14 10:12:35 »

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?
Offline UnuntuMDJ
« Reply #8 - Posted 2017-04-15 06:56:14 »

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 Smiley
Offline JaredBGreat
« Reply #9 - Posted 2017-04-15 17:19:24 »

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.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline UnuntuMDJ
« Reply #10 - Posted 2017-04-16 06:26:00 »

Thank  you Smiley
Offline meva
« Reply #11 - Posted 2017-04-18 21:08:04 »

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
Offline UnuntuMDJ
« Reply #12 - Posted 2017-04-19 14:36:37 »

Really there are many interesting "scenarios" for neural network. Share your project when it will be ready Smiley
No I didn't use the library, all from books
Offline meva
« Reply #13 - Posted 2017-04-20 22:09:53 »

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.
Pages: [1]
  ignore  |  Print  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!