Skip to content

Instantly share code, notes, and snippets.

View xiyuanHou's full-sized avatar

EvanH0923 xiyuanHou

View GitHub Profile
@xiyuanHou
xiyuanHou / pg-pong.py
Created July 24, 2017 10:12 — forked from karpathy/pg-pong.py
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward
@xiyuanHou
xiyuanHou / gist:69c1f0603ad297c6b133
Created January 11, 2016 04:16
Sublime Text 2 - Useful Shortcuts

Sublime Text 2 – Useful Shortcuts (PC)

Loosely ordered with the commands I use most towards the top. Sublime also offer full documentation.

Editing

Ctrl+C copy current line (if no selection)
Ctrl+X cut current line (if no selection)
Ctrl+⇧+K delete line
Ctrl+↩ insert line after
@xiyuanHou
xiyuanHou / 00README.rst
Created October 14, 2015 10:40 — forked from GaelVaroquaux/00README.rst
Copy-less bindings of C-generated arrays with Cython

Cython example of exposing C-computed arrays in Python without data copies

The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.

The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy

/*
working with
javax.json.jar
joda-time.jar
jollyday.jar
stanford-corenlp-3.5.1-models.jar
stanford-corenlp-3.5.1.jar
ejml-0.23.jar
in build path
*/