Skip to content

eslopezag/reinforcement-learning-cartpole

Repository files navigation

Reinforcement Learning Educational Project: Cart Pole

Ths is an educational project consisting in applying Reinforcement Learning to OpenAI Gym's Cart-Pole environment.

To simulate a naïve controller that decides what action to apply based only on the current angular position, run one of the following

make simulate_naive
python simulate_naive_controller.py

To simulate a receding horizon, model-based, predictive controller, run one of the following:

make simulate_predictive
python simulate_predictive_controller.py

To train an Reinforcement Learning agent, run one of the following:

make train algorithm=<ALGORITHM>
python cartpole_agents.py <ALGORITHM>

Where <ALGORITHM> is one of:

  • rfb_linear (linear function approximation Q Learning with features based on radial basis functions)
  • sarsa (average reward SARSA)
  • q_learning
  • avg_reward_expected_sarsa
  • discounted_expected_sarsa

To simulate an Reinforcement Learning agent that was already trained, run one of the following:

make simulate algorithm=<ALGORITHM>
python simulate_rl_agent.py <ALGORITHM>

To generate a GIF with the simulation of an agent that was already trained, run one of the following:

make generate_gif algorithm=<ALGORITHM>
python generate_gif_from_agent.py <ALGORITHM>

About

Educational project consisting in applaying Control Theory and Reinforcement Learning to OpenAI Gym's Cart-Pole environment

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors