Skip to content

Instantly share code, notes, and snippets.

View dhruvramani's full-sized avatar
👾

Dhruv Ramani dhruvramani

👾
View GitHub Profile
@dhruvramani
dhruvramani / cartpole_pg.py
Created April 2, 2019 02:59 — forked from shanest/cartpole_pg.py
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):
def __init__(self, config):
self.n_steps = self.config.hyperparams
self.n_input, self.n_hidden = 4, 20
self.lstm = tf.contrib.rnn.BasicLSTMCell(self.n_hidden, forget_bias=1.0, state_is_tuple=False)
def neural_search(self):
state = tf.Variable(tf.zeros(shape=[4]))
inp = tf.Variable(tf.random_normal(shape=[4]))
output = list()
for _ in range(self.n_steps):

Keybase proof

I hereby claim:

  • I am dhruvramani on github.
  • I am dhruvramani (https://keybase.io/dhruvramani) on keybase.
  • I have a public key whose fingerprint is 4A76 97A0 889C 6205 03F5 DF31 E625 FD7B D7A2 91CC

To claim this, I am signing this object:

#include <iostream>
#include <conio>
typedef char string[20];
void printDashes(int a[])
{
cout<<"+";
for(int i=0;i<2;i++) {
for(int j=0;j<a[i];j++)
@dhruvramani
dhruvramani / crypticKicker.py
Last active August 29, 2015 14:24
Cryptic Kicker
#Messed up code ahead!
def replace_all(text, dic):
return ''.join(dic.get(ch, ch) for ch in text)
def printStars(string):
for i in string:
if not(i == " "):
print("*" ,end="")
else:
@dhruvramani
dhruvramani / SinGraph.cpp
Last active August 29, 2015 14:12
A program to generate a Sin Graph
#include <iostream>
#include <math>
#define Length 75
int main()
{
char a[Length][Length];
for(int i=0;i<Length;i++)