Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/xviniette/flappylearning
Program learning to play Flappy Bird by machine learning (Neuroevolution)
https://github.com/xviniette/flappylearning
flappybird machine-learning neuroevolution
Last synced: 5 days ago
JSON representation
Program learning to play Flappy Bird by machine learning (Neuroevolution)
- Host: GitHub
- URL: https://github.com/xviniette/flappylearning
- Owner: xviniette
- License: mit
- Created: 2016-07-24T20:54:21.000Z (over 8 years ago)
- Default Branch: gh-pages
- Last Pushed: 2023-11-23T01:04:40.000Z (about 1 year ago)
- Last Synced: 2024-10-29T15:35:10.786Z (2 months ago)
- Topics: flappybird, machine-learning, neuroevolution
- Language: JavaScript
- Homepage: http://xviniette.github.io/FlappyLearning/
- Size: 10.9 MB
- Stars: 3,993
- Watchers: 116
- Forks: 498
- Open Issues: 13
-
Metadata Files:
- Readme: README.md
- License: License
Awesome Lists containing this project
README
# 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/img/flappy.png?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], );
```You can see the NeuroEvolution integration in Flappy Bird in [Game.js](http://github.com/xviniette/FlappyLearning/blob/gh-pages/game.js).