random search, hill climbing, policy gradient
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
README.md Update README.md Jul 13, 2016
cartpole-hill.png init Jul 2, 2016
cartpole-hill.py implementations Jul 13, 2016
cartpole-policygradient.py implementations Jul 13, 2016
cartpole-random-chart.jpg init Jul 2, 2016
cartpole-random.png init Jul 2, 2016
cartpole-random.py init Jul 2, 2016


Random search, hill climbing, policy gradient for CartPole

Simple reinforcement learning algorithms implemented for CartPole on OpenAI gym.

This code goes along with my post about learning CartPole, which is inspired by an OpenAI request for research.

##Algorithms implemented

Random Search: Keep trying random weights between [-1,1] and greedily keep the best set.

Hill climbing: Start from a random initialization, add a little noise evey iteration and keep the new set if it improved.

Policy gradient Use a softmax policy and compute a value function using discounted Monte-Carlo. Update the policy to favor action-state pairs that return a higher total reward than the average total reward of that state. Read my post about learning CartPole for a better explanation of this.