Skip to content

Instantly share code, notes, and snippets.

View kirk86's full-sized avatar

kirk86

View GitHub Profile

Emacs cheatsheet

  • C-x C-c End emacs session
  • C-g Partially quit entered command

  • C-v Move forward one screenful
  • M-v Move backward one screenful
  • C-l Move the text around the cursor to the center of the screen. Also, it clears the screen and redisplay all the text
@kirk86
kirk86 / tmux.md
Created October 29, 2015 19:39 — forked from andreyvit/tmux.md
tmux cheatsheet

tmux cheat sheet

(C-x means ctrl+x, M-x means alt+x)

Prefix key

The default prefix is C-b. If you (or your muscle memory) prefer C-a, you need to add this to ~/.tmux.conf:

remap prefix to Control + a

@kirk86
kirk86 / vncserver->xstartup
Created November 5, 2015 15:14
tight_vncserver->xstartup
#!/bin/sh
# MODS
#export PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin
#unset SESSION_MANAGER
#[ -r $HOME/.Xresources ] && xrdb $HOME/.Xresources
#xsetroot -solid grey
@kirk86
kirk86 / Caffe-Makefile.config
Created November 6, 2015 18:55
Caffe-Makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
CPU_ONLY := 1
# uncomment to disable IO dependencies and corresponding data layers
@kirk86
kirk86 / latency.txt
Created April 5, 2016 23:53 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
import sys
sys.path.append('..')
import os
import json
from time import time
import numpy as np
from tqdm import tqdm
from matplotlib import pyplot as plt
from sklearn.externals import joblib
@kirk86
kirk86 / simple_gan.py
Created June 27, 2016 18:28 — forked from Newmu/simple_gan.py
Simple Generative Adversarial Network Demo
import os
import numpy as np
from matplotlib import pyplot as plt
from time import time
from foxhound import activations
from foxhound import updates
from foxhound import inits
from foxhound.theano_utils import floatX, sharedX
@kirk86
kirk86 / conv_deconv_variational_autoencoder.py
Created June 27, 2016 18:29 — forked from Newmu/conv_deconv_variational_autoencoder.py
Prototype code of conv/deconv variational autoencoder, probably not runable, lots of inter-dependencies with local codebase =/
import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams as RandomStreams
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.extra_ops import repeat
from theano.sandbox.cuda.dnn import dnn_conv
from time import time
import numpy as np
from matplotlib import pyplot as plt
@kirk86
kirk86 / adam.py
Created June 27, 2016 18:29 — forked from Newmu/adam.py
Adam Optimizer
"""
The MIT License (MIT)
Copyright (c) 2015 Alec Radford
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
@kirk86
kirk86 / adam.py
Created June 27, 2016 18:43 — forked from skaae/adam.py
def adam(loss, all_params, learning_rate=0.001, b1=0.9, b2=0.999, e=1e-8,
gamma=1-1e-8):
"""
ADAM update rules
Default values are taken from [Kingma2014]
References:
[Kingma2014] Kingma, Diederik, and Jimmy Ba.
"Adam: A Method for Stochastic Optimization."
arXiv preprint arXiv:1412.6980 (2014).