Skip to content

Instantly share code, notes, and snippets.

View ffrige's full-sized avatar

xiaoFu ffrige

View GitHub Profile
@ffrige
ffrige / CartPole-v1.py
Last active January 23, 2023 17:09
OpenAIGym\CartPole-v1
"""
Solves the cartpole-v1 enviroment on OpenAI gym using policy search
Same algorithm as for cartpole-v0
A neural network is used to store the policy
At the end of each episode the target value for each taken action is
updated with the total normalized reward (up to a learning rate)
@ffrige
ffrige / CartPole-v0.py
Last active August 22, 2020 08:51
OpenAIGym\CartPole-v0
"""
Solves the cartpole-v0 enviroment on OpenAI gym using policy search
A neural network is used to store the policy
At the end of each episode the target value for each taken action is
updated with the total normalized reward (up to a learning rate)
Then a standard supervised learning backprop on the entire batch is
executed