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 | |
'''Caffe ResNet NetSpec example. | |
Compatible with Kaiming He's pre-trained models. | |
https://github.com/KaimingHe/deep-residual-networks | |
''' | |
import sys |
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
''' | |
Plot iteration information from the log file. | |
Usage | |
python examples/message_passing/plot_iteration.py solver.log | |
''' | |
import argparse |
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
name: "celeba_alexnet_independent" | |
layer { | |
name: "data" | |
type: "Data" | |
top: "data" | |
include { | |
phase: TRAIN | |
} | |
transform_param { | |
mirror: true |
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
# set SGE environment if exists | |
ACTIVE_JOBS_DIR=/var/spool/gridengine/execd/$(hostname)/active_jobs/ | |
if [ -d $ACTIVE_JOBS_DIR ]; then | |
PARENT_PID=$(ps -p $(ps -p $$ -o ppid --no-header) -o ppid --no-header) | |
for job_dir in $(ls -1 $ACTIVE_JOBS_DIR); do | |
JOB_PID=$(cat $ACTIVE_JOBS_DIR$job_dir/job_pid) | |
if [ $JOB_PID -eq $PARENT_PID ]; then | |
echo . $ACTIVE_JOBS_DIR$job_dir/environment | |
. $ACTIVE_JOBS_DIR$job_dir/environment | |
break |
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
// Caffe proto converter. | |
// | |
// Build. | |
// | |
// mex -I/path/to/matlab-lmdb/include ... | |
// -I/path/to/caffe/build/src/caffe/proto ... | |
// caffe_proto_.cc ... | |
// /path/to/caffe/build/src/caffe/proto/caffe.pb.o ... | |
// -lprotobuf CXXFLAGS="$CXXFLAGS -std=c++11" | |
// |
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 lmdb | |
import leveldb | |
def lmdb_reader(filename, **kwargs): | |
with lmdb.open(filename, readonly=True, create=False, **kwargs) as env: | |
with env.begin() as txn: | |
with txn.cursor() as cursor: | |
for key, value in cursor: | |
yield key, value |
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/sh | |
/System/Library/Frameworks/JavaVM.framework/Versions/A/Commands/java_home -v "1.6" |
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/sh | |
pkg-config --libs opencv | grep -E -o "/.*\.(so|dylib)" | sed "s/ /:/g" |
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
/** MEX-disptach: Macro library to build a dispatchable MEX file. | |
* | |
* Example: | |
* | |
* // mylibrary.c | |
* #include "mex-dispatch.h" | |
* void myFunction(int nlhs, mxArray** plhs, | |
* int nrhs, const mxArray** prhs) { | |
* mexPrintf("myFunction called."); | |
* } |
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
CC='clang' | |
CXX='clang++' | |
SDKROOT='/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk/' | |
MACOSX_DEPLOYMENT_TARGET='10.9' | |
CFLAGS="$CFLAGS -Dchar16_t=uint16_t" | |
CXXFLAGS="$CXXFLAGS -std=c++11 -stdlib=libc++ -DCHAR16_T" | |
CXXLIBS="$MLIBS -lc++" |