This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OpenAI Gym Cartpole implementation. | |
# Using a Policy Gradient and a 2-node 2-layer network. | |
# By Tom Jacobs | |
# | |
# Runs on Python 3. | |
# Originally based on https://github.com/kvfrans/openai-cartpole | |
# You can submit it to the OpenAI Gym scoreboard by entering your OpenAI API key and enabling submit below. | |
# It will submit only if it is considered solved. | |
import tensorflow as tf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OpenAI Cartpole implementation. | |
# Using a Policy Gradient. | |
# By Tom Jacobs | |
# | |
# Runs on Python 3. | |
# Originally based on https://github.com/kvfrans/openai-cartpole | |
# You can submit it to the OpenAI Gym scoreboard by entering your OpenAI API key and enabling submit below. | |
# It will submit only if it is considered solved. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# OpenAI Cartpole implementations. | |
# By Tom Jacobs | |
# | |
# Two methods: | |
# 1. Random: It just tries random parameters, and picks the first one that gets a 200 score. | |
# 2. Mutation: It starts with random parameters, and adds a 50% mutation on the best parameters found, each time. | |
# | |
# Runs on Python 3. | |
# Originally based on https://github.com/kvfrans/openai-cartpole |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Cartpole implementation. | |
# It just tries random parameters, and picks the first one that gets a 200 score. | |
# Runs on Python 3. | |
# You can switch submitting on and off. | |
# By Tom Jacobs | |
import gym | |
import numpy as np | |
import matplotlib.pyplot as plt |