Skip to content

FlappyLearning是一个JavaScript项目,大概仅仅800行未合并压缩的代码,创建了一个机器学习的库来实现了一个很好玩的例子来玩 Flappy Bird 。这个库里用的人工智能技术叫 Neuroevolution 应用了比较自然的一些神经系统算法,根据每次迭代的成功和失败来动态的学习。

License

Notifications You must be signed in to change notification settings

summerskyhk/FlappyLearning

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Flappy Learning (Demo)

Program that learns to play Flappy Bird by machine learning (Neuroevolution)

alt tag

NeuroEvolution.js : Utilization

// 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 integration in Flappy Bird in Game.js.

About

FlappyLearning是一个JavaScript项目,大概仅仅800行未合并压缩的代码,创建了一个机器学习的库来实现了一个很好玩的例子来玩 Flappy Bird 。这个库里用的人工智能技术叫 Neuroevolution 应用了比较自然的一些神经系统算法,根据每次迭代的成功和失败来动态的学习。

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 97.0%
  • HTML 3.0%