Skip to content

Commit c0100fc

Browse files
author
Saumitro Dasgupta
committed
Added "Network in Network" to the list of validated models
1 parent ad0ccd4 commit c0100fc

File tree

3 files changed

+37
-8
lines changed

3 files changed

+37
-8
lines changed

README.md

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,18 +15,19 @@ The output consists of two files:
1515

1616
### Examples
1717

18-
See the `examples` folder for more details.
18+
See the [examples](examples/) folder for more details.
1919

2020
## Verification
2121

2222
The following converted models have been verified on the ILSVRC2012 validation set.
2323

24-
| Model | Top 5 Accuracy |
25-
|:-----------------------------------------------|---------------:|
26-
| [VGG 16](http://arxiv.org/abs/1409.1556) | 89.88% |
27-
| [GoogLeNet](http://arxiv.org/abs/1409.4842) | 89.06% |
28-
| [CaffeNet](http://arxiv.org/abs/1408.5093) | 79.93% |
29-
| [AlexNet](http://goo.gl/3BilWd) | 79.84% |
24+
| Model | Top 5 Accuracy |
25+
|:------------------------------------------------------|---------------:|
26+
| [VGG 16](http://arxiv.org/abs/1409.1556) | 89.88% |
27+
| [GoogLeNet](http://arxiv.org/abs/1409.4842) | 89.06% |
28+
| [Network in Network](http://arxiv.org/abs/1312.4400) | 81.21% |
29+
| [CaffeNet](http://arxiv.org/abs/1408.5093) | 79.93% |
30+
| [AlexNet](http://goo.gl/3BilWd) | 79.84% |
3031

3132
## Notes
3233

examples/imagenet/models/helper.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from vgg import VGG16
1010
from alexnet import AlexNet
1111
from caffenet import CaffeNet
12+
from nin import NiN
1213

1314

1415
class DataSpec(object):
@@ -32,7 +33,7 @@ def __init__(self, batch_size, scale_size, crop_size, isotropic, channels=3, mea
3233
self.mean = mean if mean is not None else np.array([104., 117., 124.])
3334

3435
# Collection of sample auto-generated models
35-
MODELS = (AlexNet, CaffeNet, GoogleNet, VGG16)
36+
MODELS = (AlexNet, CaffeNet, GoogleNet, NiN, VGG16)
3637

3738
# The corresponding data specifications for the sample models
3839
# These specifications are based on how the models were trained.
@@ -54,6 +55,11 @@ def __init__(self, batch_size, scale_size, crop_size, isotropic, channels=3, mea
5455
crop_size=224,
5556
isotropic=False),
5657

58+
NiN: DataSpec(batch_size=500,
59+
scale_size=256,
60+
crop_size=224,
61+
isotropic=True),
62+
5763
VGG16: DataSpec(batch_size=25,
5864
scale_size=256,
5965
crop_size=224,

examples/imagenet/models/nin.py

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
from kaffe.tensorflow import Network
2+
3+
class NiN(Network):
4+
def setup(self):
5+
(self.feed('data')
6+
.conv(11, 11, 96, 4, 4, padding='VALID', name='conv1')
7+
.conv(1, 1, 96, 1, 1, name='cccp1')
8+
.conv(1, 1, 96, 1, 1, name='cccp2')
9+
.max_pool(3, 3, 2, 2, name='pool1')
10+
.conv(5, 5, 256, 1, 1, name='conv2')
11+
.conv(1, 1, 256, 1, 1, name='cccp3')
12+
.conv(1, 1, 256, 1, 1, name='cccp4')
13+
.max_pool(3, 3, 2, 2, padding='VALID', name='pool2')
14+
.conv(3, 3, 384, 1, 1, name='conv3')
15+
.conv(1, 1, 384, 1, 1, name='cccp5')
16+
.conv(1, 1, 384, 1, 1, name='cccp6')
17+
.max_pool(3, 3, 2, 2, padding='VALID', name='pool3')
18+
.conv(3, 3, 1024, 1, 1, name='conv4-1024')
19+
.conv(1, 1, 1024, 1, 1, name='cccp7-1024')
20+
.conv(1, 1, 1000, 1, 1, name='cccp8-1024')
21+
.avg_pool(6, 6, 1, 1, padding='VALID', name='pool4')
22+
.softmax(name='prob'))

0 commit comments

Comments
 (0)