A RL environment for rock paper scissors(deterministic) based on openai
Project description
Rock Paper Scissors Environment
It is just a simple version of a rock paper scissor game. However, to make the game deterministic it takes in the move of the player and learns to maximize its wins.
Running the jupyter notebook
For obvious reasons, you need to have jupyter, numpy installed in your system before running it. Once done, you can start the notebook and run the example.
What is happening in the output
You would see the following things in the output
-
a matrix -> It represents the bot experience across multiple games against the player.
-
exploiting/exploration -> The bot is fed with some initial experience (see np.uniform at the top) but it begins with exploration when it thinks it does not have any experience and then starts exploiting the already gained experience.
-
stats -> They just tell you of the moves of the player
FAQ's
- Is the bot playing against pre-defined set of moves of the player ?
No. The player's move has been randomly generated and are then used by the bot to gain experience and win.
- This isn't how the game is played. Right ?
Good find. In this version of the game I take in the user move and then train the bot to optimize itself. In my case the bot always wins after the training is complete but in the real game the bot will sometime DRAW as well since the moves of the player is random.
- How do I run your sample ?
Install the dependencies and run the notebook placed in the repo.
- How to install this package ?
pip3 install rock-paper-scissors
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for rock_paper_scissors-0.0.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 33beb1e42f95badfdbe97cee8ef9324e6295335f4cbd18f1af9a8fccff809b84 |
|
MD5 | 50a3c2fcdb78726e9cb1462a107c7c1a |
|
BLAKE2b-256 | 54824d9bf5a111c8c70fae5c695a18e7bd022a126cfbca5bb0ba6f7b7e64a633 |
Hashes for rock_paper_scissors-0.0.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef3d15f49c716e6a32a3be5fabd777bc0c51d60b6b631b1d516982f2834077b4 |
|
MD5 | 69b42995adc80585a2c2561c25e05ca9 |
|
BLAKE2b-256 | 2e7e044d7abe234666dd1150379da90dccfffdf5033351ada8c9c59d4e21af78 |