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
function[]=visualize_2D_optimizer(f,traj)
%input - trajectory matrix of size (2,n) containing n iterates of 2D optimizer's trajectory, f is a function which evaluates pointwise.
x = linspace(-3,3,30);
y = linspace(-3,3,30);
[X,Y] = meshgrid(x,y); %creating grid of points to evaluate f for the contour.
val=zeros(size(X));
for m=1:size(X,1)
for n=1:size(X,2)
val(m,n)=f([X(m,n);Y(m,n)]);
@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)
@sritee
sritee / kickstarter.ipynb
Last active August 4, 2017 08:42
Kickstarter Success Prediction Challenge - Feature Engineering Competition
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.