Giter Club home page Giter Club logo

rl-blackjack's Introduction

rl-blackjack

A reinforcement learning agent that learns to card count in Blackjack.

There are two files to run: q_learn_blackjack.py is where our agent learns the game and how to count cards. q_learn_betting.py is where out agent learns how much to bet depending on the weight of the deck. It simulates the game using our policy from q_learn_blackjack. Uncomment whichever call function in main you would like to use and run. You can alter the iteration size in their respective call functions. You can also alter the number of episodes it runs on to get its average reward in the test_performance function. Using np.loadtxt(filename), you can load in a policy to test its performance. We left one commented out in q_learn_blackjack.py, this is the policy that worked best for us.

Our environment is blackjack_env. There is nothing for you to change here but you can if you'd like. There are comments to help you understand why everything is where it is.

All the policies we gathered are in folders: history and history_t are the policies gathered for the card counting agent when we used the range -20 to 20 as our weight. weight and weight_t are the policies gathered for the card counting agentwhen we used the range -3 to 3 as our weight. bet and bet_t are the policies gathered for the betting agent.

rl-blackjack's People

Contributors

corsage avatar kshkinova avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.