Jump to content
  • Advertisement
Sign in to follow this  
phyitbos

Evolutionary Algorithms + Neural Net

This topic is 2178 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I am trying to create a program that models simple artificial life similar to what the guy made in this video:

[media]
[/media]

So far my program has some critters that scurry around my screen looking for food but with no "brain". I've never messed with neural networks before but have been reading up on them in books and online for the past few days. This particular case seems a bit different from your basic neural network in some aspects though.

It seems that his NN doesn't use any type of learning or error measuring, but rather it does this from the evolution of the creatures? I'm thinking that the weights are randomly initialized and that the creatures that are best fit / survive in general have their weights copied over to the next generation (with crossover and random mutation)? He says the brain consists of a directed graph where the edges are weights, and I'm guessing this is what he means?

Share this post


Link to post
Share on other sites
Advertisement
I have heard of this type of thing. More often I've heard of GAs using a simple rules-based tree where the rules get crossbred and mutated. Essentially any "brain" that can be summarised as a combination of numbers and logical operations could be cross-bred, although results may vary. Personally I think it's a waste to use NNs without using one of their major features.

Share this post


Link to post
Share on other sites
if you are looking for a NN algorithm that uses evolutionary methods have a look at http://www.cs.ucf.edu/~kstanley/neat.html. There are libraries there for different languages so you can just plug your inputs in if you don't want to implement it yourself.

Share this post


Link to post
Share on other sites
Just a suggestion, but if you manage to get it work, you should try higher level evolution as in what benefits the society, not what benefits the individual.

Like have a few areas, with little traffic between them, and have inputs for positions and directions etc. of other beings.

So i would imagine the best societies beings would aim for food nobody else is aiming for, while the worst just go for the nearest food, slowing down their growth as they fight for food.

Share this post


Link to post
Share on other sites

Just a suggestion, but if you manage to get it work, you should try higher level evolution as in what benefits the society, not what benefits the individual.

Like have a few areas, with little traffic between them, and have inputs for positions and directions etc. of other beings.

So i would imagine the best societies beings would aim for food nobody else is aiming for, while the worst just go for the nearest food, slowing down their growth as they fight for food.


That's interesting in that it now starts to involve game theory -- especially Nash equilibria. The problem is that "benefiting society" is really hard to codify without getting completely subjective.

One interesting note is that evolutionary algorithms will benefit society as long as you encode the right parameters. For example, if you were to rate the pieces of food not only by distance, but by proximity of other agents to it -- and then also keep track of successes and failures to acquire those items-- you will start to see agents being less competitive for the food since it benefits them to go slightly farther to get the guaranteed hit. As per Adam Smith, Nash, etc., you are still self-serving, but doing it in a way that is non-destructive to the group as a whole (via Pareto improvements).

Share this post


Link to post
Share on other sites
BTW, as a follow up on the "fighting for food" and game theory bit, check out various references to the "Hawk-Dove game" and evolutionary game theory. Basic rules are:

  • Doves will eat together
  • Hawks scare off doves and eat the food
  • Hawks fight other hawks -- and can't eat while doing so

    Therefore, if population is doves, it pays to be a hawk. If population is (multiple) hawks, it pays to be a dove. If there is 1 hawk, it is a toss-up, really.

Share this post


Link to post
Share on other sites

That's interesting in that it now starts to involve game theory -- especially Nash equilibria. The problem is that "benefiting society" is really hard to codify without getting completely subjective.


Although I'd be the first to agree that the leap from real life to a game theoretic model is huge and fraught with peril, there are some standard ideas about what "social optimality" means.

The idea is just:
- You have n players
- Each player i will choose an action; we'll call it x[sub]i[/sub].
- Each player i gets a real-number reward, r[sub]i[/sub](x[sub]1[/sub], x[sub]2[/sub], ..., x[sub]n[/sub]).
- The "societal welfare" is the sum R(x[sub]1[/sub], x[sub]2[/sub], ..., x[sub]n[/sub]) = r[sub]1[/sub](x[sub]1[/sub], x[sub]2[/sub], ..., x[sub]n[/sub]) + ... + r[sub]n[/sub](x[sub]1[/sub], x[sub]2[/sub], ..., x[sub]n[/sub]) .
- The social optimum is the point (x[sub]1[/sub], x[sub]2[/sub], ..., x[sub]n[/sub]) that minimizes R.

The important thing is that the Nash equilibrium and the social optimum will not generally be the same point. The difference between social welfares at the two points is called the price of anarchy.

The classic example is the prisoner's dilemma. Referring to this table (the first one to pop up in Google Image Search),
Game-Theory-prisoners-dilemma.gif
the Nash equilibrium is (Defect, Defect), which gives rewards of (2,2) and a social welfare of 4. But had the players chosen (Cooperate, Cooperate), they'd have gotten rewards of (3,3) and a social welfare of 6. So for this game the price of anarchy is 6-4 = 2.

If you're a benign ruler who gets to choose the rules by which your society runs, you can choose to tax certain actions in such a way (i.e., modify the individual reward functions) so that the Nash equilibrium is the social optimum. The people who figured this out got a Nobel prize in economics (although in retrospect the math doesn't seem so difficult).

The extent to which these models describe the behavior of real humans is of course debatable, and is a subject of empirical study in psychology and the social sciences.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!