Skip to content

Instantly share code, notes, and snippets.

Avatar

Shane Steinert-Threlkeld shanest

View GitHub Profile
@shanest
shanest / cartpole_pg.py
Last active Feb 17, 2020
Policy gradients for reinforcement learning in TensorFlow (OpenAI gym CartPole environment)
View cartpole_pg.py
#!/usr/bin/env python
import gym
import numpy as np
import tensorflow as tf
class PolicyGradientAgent(object):
def __init__(self, hparams, sess):