Reputation: 1064
I am currently developing a video game with some friends of mine, for a course we have in AI.
We all have different constraints ; our is to use Neural Networks to define the behavior of the AI. This part is in Python.
Basically, our game is like Towerfall, but much simpler. The map is static, the player has 5 lives, either the AI. You can move left, right, jump and click to shoot a bullet at cursor's position. So it is a battle to death.
Initially, we thought about using genetic algorithm to train our network. We defined a topology and whatever it is, we planned to optimize the weights using GA's.
The plan would be to generate populations, testing NNs directly within our game, gathering the results (fitness?) and generating a new population using the ranking of the previous ones.
But we do not really know how to implement this, or either if it is possible or if it would give good results.
Should we use a weighted average of weights during reproduction ? How to apply "mutations" ? What structure should we use to represent our NNs ?
If you have any clue or advice..!
Thanks a lot !
Upvotes: 1
Views: 1051
Reputation: 866
I prepared a complete tutorial about optimizing artificial neural networks using genetic algorithm with Python implementation. It is titled "Artificial Neural Networks Optimization using Genetic Algorithm with Python" It is available here at LinkedIn, KDnuggets, and TowardsDataScience.
You can read more and more in my 2018 book that covers GA in one of its chapters. The book is cited as “Ahmed Fawzy Gad ‘Practical Computer Vision Applications Using Deep Learning with CNNs’. Dec. 2018, Apress, 978–1–4842–4167–7” which is available here at Springer. Also here at Amazon.
Upvotes: 1