本文的目的是熟悉inception v1网络结构,以便对tvm前端有更深入的了解。
网络结构可以参考TensorFlow实现Inception系列结构这篇文章中的图。
论文在此:
Going Deeper with Convolutions
http://arxiv.org/abs/1409.4842
查看caffe2的inception v1模型文件,只考虑推理softmax2,其中包含的op有:
count operation
1 type: "AveragePool"
1 type: "Dropout"
1 type: "FC"
1 type: "Softmax"
2 type: "LRN"
9 type: "Concat"
13 type: "MaxPool"
57 type: "Conv"
57 type: "Relu"
其中,LRN就是LocalRespNorm,遗留自AlexNet,后面会被BN层代替。Dropout在最后的FC前面。
keras代码实现:
GoogLeNet in Keras
caffe2的inception v2模型文件
论文: Batch Normalization: Accelerating Deep Network Training by Reducing Internal Covariate Shift, 4.8% test error
http://arxiv.org/abs/1502.03167
v2对v1的改进:
- 加入了BN层
- 把5x5的卷积改成了2个串行的3x3卷积
cout operation
1 type: "FC"
1 type: "Softmax"
5 type: "MaxPool"
8 type: "AveragePool"
10 type: "Concat"
69 type: "Add"
69 type: "Conv"
69 type: "Mul"
69 type: "Relu"
69 type: "SpatialBN"
因此,从op上看:多了ADD,MUL,SpatialBN,少了LRN,DropOut。
inception v2 tensorflow源码实现
inception v3论文:
Rethinking the Inception Architecture for Computer Vision, 3.5% test error
http://arxiv.org/abs/1512.00567
caffe2模型文件,非官方提供,从caffe转换而来:
1 type: "Dropout"
1 type: "FC"
1 type: "Softmax"
5 type: "MaxPool"
9 type: "AveragePool"
11 type: "Concat"
94 type: "Add"
94 type: "Conv"
94 type: "Mul"
94 type: "Relu"
94 type: "SpatialBN"
从op上看,和V2没什么变化。本身的改进也主要在卷积核的大小从nxn变成了1xn和nx1。
inception v4论文:
Inception-v4, Inception-ResNet and the Impact of Residual Connections on Learning, 3.08% test error
http://arxiv.org/abs/1602.07261
inception v4 和 inception - resnet v2代码实现
https://github.com/titu1994/Inception-v4
https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_resnet_v2.py
https://github.com/tensorflow/models/blob/master/research/slim/nets/inception_v4.py
mxnet源码实现
https://github.com/apache/incubator-mxnet/blob/master/example/image-classification/symbols/inception-v4.py
没找到caffe2的prototxt文件,只有caffe模型文件 :
count operation
1 type: "constant"
1 type: "xavier"
1 type: "Dropout"
1 type: "InnerProduct"
1 type: "Softmax"
19 type: "Concat"
19 type: "Pooling"
149 type: "BatchNorm"
149 type: "Convolution"
149 type: "ReLU"
149 type: "Scale"
关于 inception系列模型更详细的资料参考:
https://blog.csdn.net/hejin_some/article/details/78636586