#Overview This is the Game Bot code for the Live Youtube session by @Sirajology. I'm using OpenAI's Gym library to train a bot in the CartPole enviroment to get better over time via reinforcement learning.
#Installation
git clone https://github.com/openai/gym
cd gym
pip install -e . # minimal install
use pip to install the dependencies
#Usage
The simple.py script is the bare minimum example of using OpenAI's Gym library. It will run an instance of the CartPole-v0 enviroment for 1000 timestep, rendering the environment at each step.
python simple.py
The complex.py script is an example of using the hill-climbing algorithm to train our agent in the CartPole-V0 enviroment. We'll start with some randomly chosen initial wieghts and in every episode, add some noise to the weights. We'll keep the new weights if the agent improves.
python simple.py
#Next
You can use the hundreds of different game enviroments that OpenAI provides to train your bot. Make your own algorithm! You can submit them to OpenAI, they've gamified the whole process with high scores. Learn more about Gym here and see this article for more in-depth coverage of these types of algorithms.