Skip to content

Commit aab8cfb

Browse files
committed
data/models folder updates
1 parent dd54ce9 commit aab8cfb

File tree

18 files changed

+2092
-0
lines changed

18 files changed

+2092
-0
lines changed

data/cifar10/get_cifar10.sh

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/usr/bin/env sh
2+
# This scripts downloads the CIFAR10 (binary version) data and unzips it.
3+
4+
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5+
cd $DIR
6+
7+
echo "Downloading..."
8+
9+
wget --no-check-certificate http://www.cs.toronto.edu/~kriz/cifar-10-binary.tar.gz
10+
11+
echo "Unzipping..."
12+
13+
tar -xf cifar-10-binary.tar.gz && rm -f cifar-10-binary.tar.gz
14+
mv cifar-10-batches-bin/* . && rm -rf cifar-10-batches-bin
15+
16+
# Creation is split out because leveldb sometimes causes segfault
17+
# and needs to be re-created.
18+
19+
echo "Done."

data/ilsvrc12/get_ilsvrc_aux.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/usr/bin/env sh
2+
#
3+
# N.B. This does not download the ilsvrcC12 data set, as it is gargantuan.
4+
# This script downloads the imagenet example auxiliary files including:
5+
# - the ilsvrc12 image mean, binaryproto
6+
# - synset ids and words
7+
# - Python pickle-format data of ImageNet graph structure and relative infogain
8+
# - the training splits with labels
9+
10+
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
11+
cd $DIR
12+
13+
echo "Downloading..."
14+
15+
wget http://dl.caffe.berkeleyvision.org/caffe_ilsvrc12.tar.gz
16+
17+
echo "Unzipping..."
18+
19+
tar -xf caffe_ilsvrc12.tar.gz && rm -f caffe_ilsvrc12.tar.gz
20+
21+
echo "Done."
768 KB
Binary file not shown.

data/mnist/get_mnist.sh

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#!/usr/bin/env sh
2+
# This scripts downloads the mnist data and unzips it.
3+
4+
DIR="$( cd "$(dirname "$0")" ; pwd -P )"
5+
cd $DIR
6+
7+
echo "Downloading..."
8+
9+
wget --no-check-certificate http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz
10+
wget --no-check-certificate http://yann.lecun.com/exdb/mnist/train-labels-idx1-ubyte.gz
11+
wget --no-check-certificate http://yann.lecun.com/exdb/mnist/t10k-images-idx3-ubyte.gz
12+
wget --no-check-certificate http://yann.lecun.com/exdb/mnist/t10k-labels-idx1-ubyte.gz
13+
14+
echo "Unzipping..."
15+
16+
gunzip train-images-idx3-ubyte.gz
17+
gunzip train-labels-idx1-ubyte.gz
18+
gunzip t10k-images-idx3-ubyte.gz
19+
gunzip t10k-labels-idx1-ubyte.gz
20+
21+
# Creation is split out because leveldb sometimes causes segfault
22+
# and needs to be re-created.
23+
24+
echo "Done."
Lines changed: 244 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,244 @@
1+
name: "AlexNet"
2+
input: "data"
3+
input_dim: 10
4+
input_dim: 3
5+
input_dim: 227
6+
input_dim: 227
7+
layers {
8+
name: "conv1"
9+
type: CONVOLUTION
10+
blobs_lr: 1
11+
blobs_lr: 2
12+
weight_decay: 1
13+
weight_decay: 0
14+
convolution_param {
15+
num_output: 96
16+
kernel_size: 11
17+
stride: 4
18+
}
19+
bottom: "data"
20+
top: "conv1"
21+
}
22+
layers {
23+
name: "relu1"
24+
type: RELU
25+
bottom: "conv1"
26+
top: "conv1"
27+
}
28+
layers {
29+
name: "norm1"
30+
type: LRN
31+
lrn_param {
32+
local_size: 5
33+
alpha: 0.0001
34+
beta: 0.75
35+
}
36+
bottom: "conv1"
37+
top: "norm1"
38+
}
39+
layers {
40+
name: "pool1"
41+
type: POOLING
42+
pooling_param {
43+
pool: MAX
44+
kernel_size: 3
45+
stride: 2
46+
}
47+
bottom: "norm1"
48+
top: "pool1"
49+
}
50+
layers {
51+
name: "conv2"
52+
type: CONVOLUTION
53+
blobs_lr: 1
54+
blobs_lr: 2
55+
weight_decay: 1
56+
weight_decay: 0
57+
convolution_param {
58+
num_output: 256
59+
pad: 2
60+
kernel_size: 5
61+
group: 2
62+
}
63+
bottom: "pool1"
64+
top: "conv2"
65+
}
66+
layers {
67+
name: "relu2"
68+
type: RELU
69+
bottom: "conv2"
70+
top: "conv2"
71+
}
72+
layers {
73+
name: "norm2"
74+
type: LRN
75+
lrn_param {
76+
local_size: 5
77+
alpha: 0.0001
78+
beta: 0.75
79+
}
80+
bottom: "conv2"
81+
top: "norm2"
82+
}
83+
layers {
84+
name: "pool2"
85+
type: POOLING
86+
pooling_param {
87+
pool: MAX
88+
kernel_size: 3
89+
stride: 2
90+
}
91+
bottom: "norm2"
92+
top: "pool2"
93+
}
94+
layers {
95+
name: "conv3"
96+
type: CONVOLUTION
97+
blobs_lr: 1
98+
blobs_lr: 2
99+
weight_decay: 1
100+
weight_decay: 0
101+
convolution_param {
102+
num_output: 384
103+
pad: 1
104+
kernel_size: 3
105+
}
106+
bottom: "pool2"
107+
top: "conv3"
108+
}
109+
layers {
110+
name: "relu3"
111+
type: RELU
112+
bottom: "conv3"
113+
top: "conv3"
114+
}
115+
layers {
116+
name: "conv4"
117+
type: CONVOLUTION
118+
blobs_lr: 1
119+
blobs_lr: 2
120+
weight_decay: 1
121+
weight_decay: 0
122+
convolution_param {
123+
num_output: 384
124+
pad: 1
125+
kernel_size: 3
126+
group: 2
127+
}
128+
bottom: "conv3"
129+
top: "conv4"
130+
}
131+
layers {
132+
name: "relu4"
133+
type: RELU
134+
bottom: "conv4"
135+
top: "conv4"
136+
}
137+
layers {
138+
name: "conv5"
139+
type: CONVOLUTION
140+
blobs_lr: 1
141+
blobs_lr: 2
142+
weight_decay: 1
143+
weight_decay: 0
144+
convolution_param {
145+
num_output: 256
146+
pad: 1
147+
kernel_size: 3
148+
group: 2
149+
}
150+
bottom: "conv4"
151+
top: "conv5"
152+
}
153+
layers {
154+
name: "relu5"
155+
type: RELU
156+
bottom: "conv5"
157+
top: "conv5"
158+
}
159+
layers {
160+
name: "pool5"
161+
type: POOLING
162+
pooling_param {
163+
pool: MAX
164+
kernel_size: 3
165+
stride: 2
166+
}
167+
bottom: "conv5"
168+
top: "pool5"
169+
}
170+
layers {
171+
name: "fc6"
172+
type: INNER_PRODUCT
173+
blobs_lr: 1
174+
blobs_lr: 2
175+
weight_decay: 1
176+
weight_decay: 0
177+
inner_product_param {
178+
num_output: 4096
179+
}
180+
bottom: "pool5"
181+
top: "fc6"
182+
}
183+
layers {
184+
name: "relu6"
185+
type: RELU
186+
bottom: "fc6"
187+
top: "fc6"
188+
}
189+
layers {
190+
name: "drop6"
191+
type: DROPOUT
192+
dropout_param {
193+
dropout_ratio: 0.5
194+
}
195+
bottom: "fc6"
196+
top: "fc6"
197+
}
198+
layers {
199+
name: "fc7"
200+
type: INNER_PRODUCT
201+
blobs_lr: 1
202+
blobs_lr: 2
203+
weight_decay: 1
204+
weight_decay: 0
205+
inner_product_param {
206+
num_output: 4096
207+
}
208+
bottom: "fc6"
209+
top: "fc7"
210+
}
211+
layers {
212+
name: "relu7"
213+
type: RELU
214+
bottom: "fc7"
215+
top: "fc7"
216+
}
217+
layers {
218+
name: "drop7"
219+
type: DROPOUT
220+
dropout_param {
221+
dropout_ratio: 0.5
222+
}
223+
bottom: "fc7"
224+
top: "fc7"
225+
}
226+
layers {
227+
name: "fc8"
228+
type: INNER_PRODUCT
229+
blobs_lr: 1
230+
blobs_lr: 2
231+
weight_decay: 1
232+
weight_decay: 0
233+
inner_product_param {
234+
num_output: 1000
235+
}
236+
bottom: "fc7"
237+
top: "fc8"
238+
}
239+
layers {
240+
name: "prob"
241+
type: SOFTMAX
242+
bottom: "fc8"
243+
top: "prob"
244+
}

models/bvlc_alexnet/readme.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
---
2+
name: BVLC AlexNet Model
3+
caffemodel: bvlc_alexnet.caffemodel
4+
caffemodel_url: http://dl.caffe.berkeleyvision.org/bvlc_alexnet.caffemodel
5+
license: non-commercial
6+
sha1: 9116a64c0fbe4459d18f4bb6b56d647b63920377
7+
caffe_commit: 709dc15af4a06bebda027c1eb2b3f3e3375d5077
8+
---
9+
10+
This model is a replication of the model described in the [AlexNet](http://papers.nips.cc/paper/4824-imagenet-classification-with-deep-convolutional-neural-networks) publication.
11+
12+
Differences:
13+
- not training with the relighting data-augmentation;
14+
- initializing non-zero biases to 0.1 instead of 1 (found necessary for training, as initialization to 1 gave flat loss).
15+
16+
The bundled model is the iteration 360,000 snapshot.
17+
The best validation performance during training was iteration 358,000 with validation accuracy 57.258% and loss 1.83948.
18+
This model obtains a top-1 accuracy 57.1% and a top-5 accuracy 80.2% on the validation set, using just the center crop.
19+
(Using the average of 10 crops, (4 + 1 center) * 2 mirror, should obtain a bit higher accuracy.)
20+
21+
## License
22+
23+
The data used to train this model comes from the ImageNet project, which distributes its database to researchers who agree to a following term of access:
24+
"Researcher shall use the Database only for non-commercial research and educational purposes."
25+
Accordingly, this model is distributed under a non-commercial license.
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
net: "models/bvlc_alexnet/train_val.prototxt"
2+
test_iter: 1000
3+
test_interval: 1000
4+
base_lr: 0.01
5+
lr_policy: "step"
6+
gamma: 0.1
7+
stepsize: 100000
8+
display: 20
9+
max_iter: 450000
10+
momentum: 0.9
11+
weight_decay: 0.0005
12+
snapshot: 10000
13+
snapshot_prefix: "models/bvlc_alexnet/caffe_alexnet_train"
14+
solver_mode: GPU

0 commit comments

Comments
 (0)