This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Script for installing tmux on systems where you don't have root access. | |
# tmux will be installed in $HOME/local/bin. | |
# Either wget or curl is required. | |
# It's assumed that a C/C++ compiler are installed. | |
# exit on error | |
set -e |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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 | |
# create our directories |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
INDIR=$1 | |
OUTDIR=$2 | |
echo "Cloning leveldb in ${INDIR} to ${OUTDIR}" | |
INPATH=`realpath ${INDIR}` | |
mkdir -p ${OUTDIR} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sshput () { | |
RSAKEY="${HOME}/.ssh/id_rsa.pub" | |
DSAKEY="${HOME}/.ssh/id_dsa.pub" | |
if [ $# -eq 2 ]; then | |
KEY=$1 | |
if [ ! -r $KEY ] | |
then | |
echo "'$KEY' does not exist or is not readable" | |
return 1 |
This file has been truncated, but you can view the full file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I1224 11:43:56.783612 2133 train_net.cpp:26] Starting Optimization | |
I1224 11:43:56.783983 2133 solver.cpp:26] Creating training net. | |
I1224 11:43:56.784008 2133 net.cpp:66] Creating Layer data | |
I1224 11:43:56.784013 2133 net.cpp:101] data -> data | |
I1224 11:43:56.784023 2133 net.cpp:101] data -> label | |
I1224 11:43:56.784036 2133 data_layer.cpp:122] Opening leveldb /home/jdonahue/caffe-train-leveldb | |
I1224 11:43:56.956717 2133 data_layer.cpp:159] output data size: 256,3,227,227 | |
I1224 11:43:56.956765 2133 data_layer.cpp:176] Loading mean file from/home/jiayq/ilsvrc2012_mean.binaryproto | |
I1224 11:43:57.016316 2133 net.cpp:116] Top shape: 3 227 227 | |
I1224 11:43:57.016341 2133 net.cpp:116] Top shape: 1 1 1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
layer { | |
name: "data" | |
type: "DummyData" | |
top: "data" | |
top: "label" | |
dummy_data_param { | |
shape { dim: [128, 3, 227, 227] } | |
shape { dim: [128] } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try: | |
range = xrange # Python 2 | |
except NameError: | |
pass # Python 3 | |
def lazy_product(*iter_funcs, **kwargs): | |
""" | |
If f1, f2, ..., are functions which have no (required) arguments and | |
return iterables, then | |
lazy_product(f1, f2, ..., repeat=k) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# usage: python count_caffemodel_params.py /path/to/my.caffemodel [/path/to/my/other.caffemodel, ...] | |
from caffe.proto import caffe_pb2 | |
import sys | |
assert len(sys.argv) >= 2 | |
for caffemodel_filename in sys.argv[1:]: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
from __future__ import division | |
import functools | |
import itertools | |
import numpy as np | |
import os | |
import matplotlib.pyplot as plt | |
from PIL import Image |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
def canonical_axis(x, axis): | |
def is_int_ndarray(x): | |
if not isinstance(x, np.ndarray): | |
return False | |
dtype = str(x.dtype) | |
prefixes = 'int', 'uint' | |
return any(dtype.startswith(p) for p in prefixes) | |
if axis is None: |
OlderNewer