Buidling neural network to solve OpenAI's cart pole balancing environment.
CartPole.mov
This environment corresponds to the version of the cart-pole problem described by Barto, Sutton, and Anderson in "Neuronlike Adaptive Elements That Can Solve Difficult Learning Control Problem". A pole is attached by an un-actuated joint to a cart, which moves along a frictionless track. The pendulum is placed upright on the cart and the goal is to balance the pole by applying forces in the left and right direction on the cart1
Since the goal is to keep the pole upright for as long as possible, a reward of +1
for every step taken, including the termination step, is allotted. The threshold for rewards is 50.
All observations are assigned a uniformly random value in (0.0, 2.0)
- It has 6 fully connected layers followed by dropout layers with categorical cross entropy loss and Adam optimizer with a learning rate of 1e-3.
To run CartPole locally perform the following steps (requires Python 3.7+):
git clone https://github.com/Suraj-Bhor/CartPole.git
cd Cartpole
pip install -r requirements.txt
python cartpole.py
To visualize graphs the model saves the tensorboard checkpoints to /tmp/tflearn_logs/
.
Once the model is trained you can visualize the results buy issuing the following command.
tensorboard --logdir='/tmp/tflearn_logs'