Skip to content

Commit

Permalink
README
Browse files Browse the repository at this point in the history
  • Loading branch information
xviniette committed Jul 25, 2016
1 parent 64629d8 commit ce39fc2
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,37 @@
# FlappyLearning
# [Play Online](https://xviniette.github.io/FlappyLearning/ "https://xviniette.github.io/FlappyLearning/")
# Flappy Learning ([Demo](http://xviniette.github.io/FlappyLearning/))

Program that learns to play Flappy Bird by machine learning ([Neuroevolution](http://www.scholarpedia.org/article/Neuroevolution))

![alt tag](https://github.com/xviniette/FlappyLearning/blob/gh-pages/doc/flappy.gif?raw=true)

### [NeuroEvolution.js](http://github.com/xviniette/FlappyLearning/blob/gh-pages/Neuroevolution.js) : Utilization

```javascript
// Initialize
var ne = new Neuroevolution({options});

//Default options values
var options = {
network:[1, [1], 1], // Perceptron structure
population:50, // Population by generation
elitism:0.2, // Best networks kepts unchanged for the next generation (rate)
randomBehaviour:0.2, // New random networks for the next generation (rate)
mutationRate:0.1, // Mutation rate on the weights of synapses
mutationRange:0.5, // Interval of the mutation changes on the synapse weight
historic:0, // Latest generations saved
lowHistoric:false, // Only save score (not the network)
scoreSort:-1, // Sort order (-1 = desc, 1 = asc)
nbChild:1 // number of child by breeding
}

//Update options at any time
ne.set({options});

// Generate first or next generation
var generation = ne.nextGeneration();

//When an network is over -> save this score
ne.networkScore(generation[x], <score = 0>);
```

You can see the NeuroEvolution intégration in Flappy Bird in [Game.js](http://github.com/xviniette/FlappyLearning/blob/gh-pages/game.js).

0 comments on commit ce39fc2

Please sign in to comment.