- Depthwise convolution (mobilenet)
- Shufflenet
- Densenet
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
"""References: | |
Andrew G. Howard, Menglong Zhu, Bo Chen, Dmitry Kalenichenko, Weijun Wang, | |
Tobias Weyand, Marco Andreetto, Hartwig Adam. | |
"MobileNets: Efficient Convolutional Neural Networks for Mobile Vision Applications." | |
arXiv preprint arXiv:1704.04861 | |
""" | |
import mxnet as mx | |
def depthwise_conv(data, kernel, pad, num_filter, num_group, stride, name): | |
conv = mx.symbol.Convolution(data=data, kernel=kernel, pad=pad, stride=stride, |
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 mxnet as mx | |
def inflated_layer(data, num_in, num_out, name): | |
assert(num_out % num_in == 0) | |
num_group = num_out / num_in | |
outputs = [] | |
for i in range(num_group): | |
bias = mx.sym.Variable(shape=(1, num_in, 1, 1), | |
name="{}_{}_bias".format(name, i)) | |
outputs.append(mx.sym.broadcast_add(lhs=data, rhs=bias)) |
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
"""References: | |
Simonyan, Karen, and Andrew Zisserman. "Very deep convolutional networks for | |
large-scale image recognition." arXiv preprint arXiv:1409.1556 (2014). | |
""" | |
import mxnet as mx | |
def depthwise_conv(data, kernel, pad, num_filter, name, num_group): | |
conv = mx.symbol.Convolution(data=data, kernel=kernel, pad=pad, | |
num_filter=num_group, name=name+'_depthwise', num_group=num_group) |
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 | |
OLD_CLASSES = ['aeroplane', 'bicycle', 'bird', 'boat', 'bottle', 'bus', 'car', | |
'cat', 'chair', 'cow', 'diningtable', 'dog', 'horse', 'motorbike', | |
'person', 'pottedplant', 'sheep', 'sofa', 'train', 'tvmonitor'] | |
NEW_CLASSES = ['bicycle', 'bus', 'car', 'cat', 'cow', 'dog', 'horse', 'motorbike', | |
'person', 'train'] | |
OLD_INDICES = [OLD_CLASSES.index(x) for x in NEW_CLASSES] |
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 mxnet as mx | |
print(mx.__version__) | |
import time | |
import os | |
print('worker:', os.environ.get('MXNET_CPU_WORKER_NTHREADS', 1)) | |
num_batch = 100 | |
batch_size = 32 | |
data_shape = (3, 224, 224) |
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: "GoogleNet" | |
layer { | |
name: "data" | |
type: "Input" | |
top: "data" | |
input_param { shape: { dim: 10 dim: 3 dim: 224 dim: 224 } } | |
} | |
layer { | |
name: "conv1/7x7_s2" | |
type: "Convolution" |
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 mxnet as mx | |
import numpy as np | |
from timeit import default_timer as timer | |
def get_bench_net(num_hidden=10000): | |
data = mx.sym.var('data') | |
fc = mx.sym.FullyConnected(data, num_hidden=num_hidden) | |
return fc | |
num_out = 10000 |
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
python train_imagenet.py --data-train ~/data/train.rec --data-val ~/data/val.rec --gpus 0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15 --data-nthreads 32 --network resnet101_v2 --batch-size 256 --top-k 5 --model-prefix model/resnet101_v2 --min-random-scale 0.533 --max-random-shear-ratio 0 --max-random-rotate-angle 0 --max-random-h 0 --max-random-l 0 --max-random-s 0 --lr-step-epochs 30,60,90 --num-epochs 120 --rgb-std '58.395,57.12,57.375' |
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
(function() { | |
// Chart design based on the recommendations of Stephen Few. Implementation | |
// based on the work of Clint Ivy, Jamie Love, and Jason Davies. | |
// http://projects.instantcognition.com/protovis/bulletchart/ | |
d3.bullet = function() { | |
var orient = "left", // TODO top & bottom | |
reverse = false, | |
duration = 0, | |
ranges = bulletRanges, |
OlderNewer