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
# Imports | |
import os | |
import sys | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pdb as pdb | |
from scipy import ndimage as nd | |
from scipy import signal | |
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 time | |
import sys | |
print 'hello', | |
sys.stdout.flush() | |
time.sleep(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
git clone https://github.com/vlfeat/matconvnet.git | |
cd matconvnet/matlab | |
run vl_setupnn | |
run vl_compilenn('enableGpu', true) | |
run vl_testnn('gpu', 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
import find_mxnet | |
import mxnet as mx | |
from load_data import load | |
from sklearn.cross_validation import train_test_split | |
import logging | |
import pdb as pdb | |
import numpy as np | |
import matplotlib.pyplot as plt |
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
grep MXNET_REGISTER_OP_PROPERTY . -R | |
./src/operator/cross_device_copy.cc: MXNET_REGISTER_OP_PROPERTY(_CrossDeviceCopy, CrossDeviceCopyProp) | |
./src/operator/convolution.cc: MXNET_REGISTER_OP_PROPERTY(Convolution, ConvolutionProp) | |
./src/operator/elementwise_sum.cc: MXNET_REGISTER_OP_PROPERTY(ElementWiseSum, ElementWiseSumProp) | |
./src/operator/activation.cc: MXNET_REGISTER_OP_PROPERTY(Activation, ActivationProp) | |
./src/operator/reshape.cc: MXNET_REGISTER_OP_PROPERTY(Reshape, ReshapeProp) | |
./src/operator/reshape.cc: MXNET_REGISTER_OP_PROPERTY(Flatten, FlattenProp) | |
./src/operator/fully_connected.cc: MXNET_REGISTER_OP_PROPERTY(FullyConnected, FullyConnectedProp) | |
./src/operator/softmax_output.cc: MXNET_REGISTER_OP_PROPERTY(SoftmaxOutput, SoftmaxOutputProp) | |
./src/operator/softmax_output.cc: MXNET_REGISTER_OP_PROPERTY(Softmax, DeprecatedSoftmaxProp) |
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 | |
import pdb as pdb | |
def batchnorm_forward(x, gamma, beta, eps): | |
N, D = x.shape | |
#step1: calciulate mean |
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 | |
import pdb as pdb | |
np.random.seed(0) | |
b = 5 | |
h = 10 | |
m = 3 | |
# forward pass | |
W = np.random.randn(b, h) |
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
//: Playground - noun: a place where people can play | |
import UIKit | |
var str = "Hello, playground" | |
// | |
// Closure basicsg | |
// |
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
# 1. Generate .d file | |
g++ -std=c++11 -I`pwd`/../../OpenBLAS/installed/lib -MD -MF mxnet_predict0.d -I `pwd`/../ -I `pwd`/../mshadow/ -I `pwd`/../dmlc-core/include -I `pwd`/../include -c mxnet_predict0.cc | |
rm mxnet_predict0.o | |
# 2. Run python script | |
Generating amalgamation to mxnet_predict-all.cc | |
python ./amalgamation.py mxnet_predict0.d mxnet_predict0.cc mxnet_predict-all.cc 0 | |
Not processed: mxnet_predict0.o: | |
# 3. Compile amalgamate code |
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
For automatic parameter setup, the filename must contain the following tokens, in any order. | |
whatever_widthxheight_rateHz_precb_format.yuv | |
width = integer number, the frame width in pixel | |
height = integer number, the frame height in pixel | |
rate = real number, the frames per second to be rendered |