Skip to content

Instantly share code, notes, and snippets.

View sritee's full-sized avatar
🍐
pear programming

Sridhar Thiagarajan sritee

🍐
pear programming
View GitHub Profile
@sritee
sritee / PG.py
Last active June 7, 2018 19:54 — forked from MikeOuimet/PG.py
Vanilla policy gradient with tensorflow
#improved GIST of https://gist.github.com/MikeOuimet/f50904374651c9c15f236aef3109d57
#allowed backwards compatability by refactoring code involving tf.diag gradients
import numpy as np
import gym
import tensorflow as tf
import matplotlib.pyplot as plt
def weight_variable(shape):
initial = tf.truncated_normal(shape, stddev=0.1)