Skip to content

Instantly share code, notes, and snippets.

View dexhunter's full-sized avatar
💭
I may be slow to respond.

Dixing (Dex) Xu dexhunter

💭
I may be slow to respond.
View GitHub Profile
@dexhunter
dexhunter / 0_reuse_code.js
Created May 3, 2016 13:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@dexhunter
dexhunter / simplex_projection.py
Created April 5, 2017 04:33 — forked from brucespang/simplex_projection.py
Compute Euclidean projections on the simplex or L1-ball
""" Module to compute projections on the positive simplex or the L1-ball
A positive simplex is a set X = { \mathbf{x} | \sum_i x_i = s, x_i \geq 0 }
The (unit) L1-ball is the set X = { \mathbf{x} | || x ||_1 \leq 1 }
Adrien Gaidon - INRIA - 2011
"""
@dexhunter
dexhunter / geo_median.py
Created April 13, 2017 01:59 — forked from endolith/geo_median.py
Computing the geometric median in Python by Daniel J Lewis
import math
from dbfpy import dbf
import matplotlib.pyplot as plt
#create a plot
fig = plt.figure(1, figsize = [10,10], dpi=90)
axScatter = plt.subplot(111)
def candMedian(dataPoints):
#Calculate the first candidate median as the geometric mean
@dexhunter
dexhunter / tmux_local_install.sh
Created April 21, 2017 11:50
tmux_without_root
# Exit on error #
set -e
# Clean up #
rm -rf ~/tools/programs/libevent
rm -rf ~/tools/programs/ncurses
rm -rf ~/tools/programs/tmux
# Variable version #
TMUX_VERSION=2.2
@dexhunter
dexhunter / tmux-cheatsheet.markdown
Created April 22, 2017 10:11 — forked from MohamedAlaa/tmux-cheatsheet.markdown
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
#!/bin/sh
git filter-branch --env-filter '
OLD_EMAIL="your-old-email@example.com"
CORRECT_NAME="Your Correct Name"
CORRECT_EMAIL="your-correct-email@example.com"
if [ "$GIT_COMMITTER_EMAIL" = "$OLD_EMAIL" ]
then
@dexhunter
dexhunter / Batch Normalization.md
Created June 8, 2017 09:08 — forked from shagunsodhani/Batch Normalization.md
Notes for "Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift" paper

The Batch Normalization paper describes a method to address the various issues related to training of Deep Neural Networks. It makes normalization a part of the architecture itself and reports significant improvements in terms of the number of iterations required to train the network.

Issues With Training Deep Neural Networks

Internal Covariate shift

Covariate shift refers to the change in the input distribution to a learning system. In the case of deep networks, the input to each layer is affected by parameters in all the input layers. So even small changes to the network get amplified down the network. This leads to change in the input distribution to internal layers of the deep network and is known as internal covariate shift.

It is well established that networks converge faster if the inputs have been whitened (ie zero mean, unit variances) and are uncorrelated and internal covariate shift leads to just the opposite.

@dexhunter
dexhunter / pg-pong.py
Created July 3, 2017 00:55 — 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
# On Ubuntu 14.04 with Titan X (compute capability 5.2)
# There are some missing parts that you have to specify, and some files you have to download manaully from web, so don't run this script file as it is.
# Configure CUDA paths
echo export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/usr/local/cuda/lib64" >> ~/.bashrc
echo export CUDA_HOME="/usr/local/cuda" >> ~/.bashrc
source ~/.bashrc
 
# Set up java
# Dependencies for Bazel
# Download jdk 8
@dexhunter
dexhunter / readme.md
Created July 7, 2017 11:20 — forked from baraldilorenzo/readme.md
VGG-16 pre-trained model for Keras

##VGG16 model for Keras

This is the Keras model of the 16-layer network used by the VGG team in the ILSVRC-2014 competition.

It has been obtained by directly converting the Caffe model provived by the authors.

Details about the network architecture can be found in the following arXiv paper:

Very Deep Convolutional Networks for Large-Scale Image Recognition

K. Simonyan, A. Zisserman