Skip to content

Instantly share code, notes, and snippets.

View shanest's full-sized avatar

Shane Steinert-Threlkeld shanest

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