javascript - Training Neural Network to play flappy bird with genetic algorithm - Why can't it learn? -


i have been learning neural networks , genetic algorithms, , test learning, have tried make ai learns play flappy bird:

screenshot of program

i have left running @ least 10 hours (overnight , longer), fittest member still fails show significant advancements in intelligence when began simulation apart avoiding floor , ceilings. inputs rays (as can see above) act sight lines, , network fed in lengths, , birds vertical velocity. seems best bird ignoring sight lines except horizontal one, , when short, jumping. output number between 0 , 1, if output larger 0.5, bird jumps. there 4 hidden layers, 15 neurons each, input layer feeding forward first hidden layers, 1st hidden layer feeding forward 2nd 1 ... , final hidden layer feeding forward output, dna of bird array of real numbers representing weights of neural networks, have made project using same style of neural network, , genetic algorithm, in ants had travel food, , worked perfectly.

here code: https://github.com/karan0110/flappy-bird-ai

please in comments if need additional information

please can whether method flawed or not, code works correctly (i got previous working project).

i idea, suggest change things.

  • don't use network fixed structure. neural evolution of autgmenting topologies , rather implement yourself, or use library neataptic.

    • i don't believe network needs many inputs. believe 3-5 sensors (20-50° gaps) enough, since many of input values seem similar.

if not sure why project not working try this:

  • try view image of current best network. if network doesn't take important sensors (like velocity) account, you'll see instantly.

  • make sure of sensors working fine (looks fine in image above) , sure nkrmalize values in meaningful way.

  • check if maximum & average score increases on time. if doesn't ga isn't working or networ receives inputs not enough solve problem.

one trick helped me out lot, keep elite of ga in seperate array. replace elite networks if other network has performed better elite. keep elite trough generations, once algorithm finds extraordinarily solution, won't lost in future generation if nothing else performs better.


Comments

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -