Skip to content

Instantly share code, notes, and snippets.

@chriswl
chriswl / pg-pong.py
Created October 7, 2016 08:56 — 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
@chriswl
chriswl / tmux_local_install.sh
Last active September 21, 2016 10:23 — forked from ryin/tmux_local_install.sh
bash script for installing tmux without root access
#!/bin/bash
# Script for installing tmux on systems where you don't have root access.
# tmux will be installed in $HOME/local/bin.
# It's assumed that wget and a C/C++ compiler are installed.
# exit on error
set -e
TMUX_VERSION=2.2
@chriswl
chriswl / .ycm_extra_conf.py
Created February 23, 2016 14:53 — forked from galou/.ycm_extra_conf.py
YouCompleteMe configuration file for ROS, copy to $ROS_WORKSPACE
# -*- coding: utf-8 -*-
##########################################################################
# YouCompleteMe configuration for ROS #
# Author: Gaël Ecorchard (2015) #
# #
# The file requires the definition of the $ROS_WORKSPACE variable in #
# your shell. #
# Name this file .ycm_extra_conf.py and place it in $ROS_WORKSPACE to #
# use it. #
Anonymous UUID: 45D5454D-07F4-440C-EE1B-AE2168D3C727
Thu Apr 23 13:20:29 2015
*** Panic Report ***
panic(cpu 0 caller 0xffffff800d3bc005): "vm_object_compressor_pager_create(0xffffff800daaaf68): " "object size 0xfffffffffffff000 >= 0xffffffff000\n"@/SourceCache/xnu/xnu-2782.10.73/osfmk/vm/vm_object.c:4835
Backtrace (CPU 0), Frame : Return Address
0xffffff80a5c9be50 : 0xffffff800d32fe41
0xffffff80a5c9bed0 : 0xffffff800d3bc005
0xffffff80a5c9bf10 : 0xffffff800d3cd5a6
# NOTE: These instructions do not represent a robust, self-troubleshooting install; they
# are definitely not suitable for dumping to a giant script and running as one. If you
# use them, they should be run one at a time, with an eye out for errors or problems
# along the way.
#
# The #1 issue you are likely to encounter is with Homebrew or Python packages whose
# binary components link against system Python. This will result in runtime segfaults,
# especially in rviz. If you suspect this is occurring, you can attempt to remove and
# reinstall the offending packages, or go for the nuclear option--- empty your Cellar
# and site-packages folders and start over with brewed python from the beginning.
@chriswl
chriswl / .gitignore
Last active August 29, 2015 14:07 — forked from octocat/.gitignore
# Compiled source #
###################
*.com
*.class
*.dll
*.exe
*.o
*.so
# Packages #
@chriswl
chriswl / custom.js
Created September 2, 2014 17:00
ipython config
$([IPython.events]).on('app_initialized.NotebookApp', function(){
var custom_command_shortcuts = {
'shift-r' : {
help : 'run all cells',
help_index : 'zy',
handler : function (event) {
IPython.notebook.execute_all_cells();
return false;
}
},
# coding:utf-8
# Copyright 2011 litl, LLC. All Rights Reserved.
import httplib
import re
import urllib
import urlparse
from flask import Blueprint, request, Response, url_for
from werkzeug.datastructures import Headers
{
"metadata": {
"name": ""
},
"nbformat": 3,
"nbformat_minor": 0,
"worksheets": [
{
"cells": [
{
{
"folders":
[
{
"path": "/Users/chriswl/work/pyference"
}
],
"build_systems":
[
{