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-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
@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
@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

@dexhunter
dexhunter / png2jpg.py
Created August 8, 2017 08:56 — forked from qingswu/png2jpg.py
Convert all png images in current folder to jpg using OpenCV cv2
#!/usr/bin/env python
from glob import glob
import cv2
pngs = glob('./*.png')
for j in pngs:
img = cv2.imread(j)
cv2.imwrite(j[:-3] + 'jpg', img)
@dexhunter
dexhunter / Top 50 Universities List.md
Created December 23, 2017 05:37 — forked from Tims101/Top 50 Universities List.md
Top 50 Computer Science Universities

Universities

Massachusetts Institute of Technology (MIT)

###phd###

  • MIT Graduate Admissions link
  • PhD Program - MIT Sloan School of Management link
  • MIT - Massachusetts Institute of Technology link
  • to view contact information for all departments. - MIT link
@dexhunter
dexhunter / breachcompilation.txt
Created December 31, 2017 08:05
1.4 billion password breach compilation wordlist
wordlist created from original 41G stash via:
grep -rohP '(?<=:).*$' | uniq > breachcompilation.txt
Then, compressed with:
7z a breachcompilation.txt.7z breachcompilation.txt
Size: