Software Programming

Kunuk Nykjaer

Mario AI EANN (evolutionary artifical neural network)

leave a comment »


I implemented a hybrid of GA and NN for an agent which plays Mario.
Training method with Genetic algorithm using a NN as a candidate in the population.
A mario framework game is provided by http://marioai.com where you get environment information, and you apply actions to the agent.

Here are two videos of my agent. I didn’t really manage to make it a generalized agent (performs good on unseen levels) but it manage well on levels which is has been trained for (over-fitting).

Below the screen is the input to the NN
Two matrix’s, one with levelscene (5×5), the other with enemies (5×5)
And then some states:
isOnGround, canJump, canShoot, marioMode, blockInFront?, enemyInFront?, pitInFront?
Outputs are: jump, left, right, fire/speed

Input 7, no matrix

Input 57, 5×5 matrix

NN topology
one hidden layer with size 20
Total outputs: 4

———-
Training method:
Fitness is distance passed + 1024 win bonus
Population 100
Generations: until level completed or maxloop is exceeded
Tournament selection
Elitism 20% no steady state
Gaussian mutation 2%
Montana uniform crossover

Advertisements

Written by kunuk Nykjaer

December 16, 2010 at 4:00 pm

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: