Git Product home page Git Product logo

q-learning-survival's Introduction

ReinforcementLearning

Predator-Prey Simulator using "deep" Q-learning (hardly deep)

Recently I've been reading up on machine learning literature, watching Andrej Karpathy's zero to hero playlist, and just found Lilian Weng's blogs. I wanted to try implementing some of what I was studying + I still hadn't taught myself python so this was a good place to start.

If you want to play around with it

Create animals by either using the prebuilt fox, rabbit or default animal class or make your own by inheriting, defining all the animals parameters and then calling super.

Tweak the brain by changing parameters such as the decay factor:gamma, the learning rate:alpha, and the probability to explore rather than exploit:epsilon

Pygame isn't super fast and I haven't optimized so limit the number of animals at a single time

If you want some real deep Q-learning just make one animal with a deep network and make a bunch of dummy predators and prey that our animal can learn from

Tools

Pygame, Pytorch, and Matplotlib

References

Sources for reinforcement learning: https://lilianweng.github.io/posts/2018-02-19-rl-overview/ https://www.cs.huji.ac.il/~shais/UnderstandingMachineLearning/understanding-machine-learning-theory-algorithms.pdf

Source for algorithm used to train: https://www.cs.swarthmore.edu/~meeden/cs63/s15/nature15b.pdf

Source for learning pytorch: https://www.youtube.com/playlist?list=PLAqhIrjkxbuWI23v9cThsA9GvCAUhRvKZ

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.