Composite symbols into component

In this example we will show how to make an Inception network by forming single symbol into component.

Inception is currently best model. Compared to other models, it has much less parameters, and with best performance. However, it is much more complex than sequence feedforward network.

The Inception network in this example is refer to Ioffe, Sergey, and Christian Szegedy. "Batch normalization: Accelerating deep network training by reducing internal covariate shift." arXiv preprint arXiv:1502.03167 (2015).


In [25]:
import mxnet as mx

For complex network such as inception network, building from single symbol is painful, we can make simple ComponentFactory to simplfiy the procedure.

Except difference in number of filter, we find 2 major differences in each Inception module, so we can build two factories plus one basic Convolution + BatchNorm + ReLU factory to simplfiy the problem.


In [26]:
# Basic Conv + BN + ReLU factory
def ConvFactory(data, num_filter, kernel, stride=(1,1), pad=(0, 0), name=None, suffix=''):
    conv = mx.symbol.Convolution(data=data, num_filter=num_filter, kernel=kernel, stride=stride, pad=pad, name='conv_%s%s' %(name, suffix))
    bn = mx.symbol.BatchNorm(data=conv, fix_gamma=False, eps=1e-5 + 1e-10, momentum=0.9, name='bn_%s%s' %(name, suffix))
    act = mx.symbol.Activation(data=bn, act_type='relu', name='relu_%s%s' %(name, suffix))
    return act

We can visualize our basic component


In [27]:
prev = mx.symbol.Variable(name="Previos Output")
conv_comp = ConvFactory(data=prev, num_filter=64, kernel=(7,7), stride=(2, 2))
mx.viz.plot_network(symbol=conv_comp)


Out[27]:
plot Previos Output Previos Output conv_None Convolution 7x7/2, 64 conv_None->Previos Output bn_None BatchNorm bn_None->conv_None relu_None Activation relu relu_None->bn_None

The next step is making a component factory with all stride=(1, 1)


In [28]:
# param mapping to paper:
# num_1x1      >>>  #1x1
# num_3x3red   >>>  #3x3 reduce
# num_3x3      >>>  #3x3
# num_d3x3red  >>>  double #3x3 reduce
# num_d3x3     >>>  double #3x3
# pool         >>>  Pool
# proj         >>>  proj
def InceptionFactoryA(data, num_1x1, num_3x3red, num_3x3, num_d3x3red, num_d3x3, pool, proj, name):
    # 1x1
    c1x1 = ConvFactory(data=data, num_filter=num_1x1, kernel=(1, 1), name=('%s_1x1' % name))
    # 3x3 reduce + 3x3
    c3x3r = ConvFactory(data=data, num_filter=num_3x3red, kernel=(1, 1), name=('%s_3x3' % name), suffix='_reduce')
    c3x3 = ConvFactory(data=c3x3r, num_filter=num_3x3, kernel=(3, 3), pad=(1, 1), name=('%s_3x3' % name))
    # double 3x3 reduce + double 3x3
    cd3x3r = ConvFactory(data=data, num_filter=num_d3x3red, kernel=(1, 1), name=('%s_double_3x3' % name), suffix='_reduce')
    cd3x3 = ConvFactory(data=cd3x3r, num_filter=num_d3x3, kernel=(3, 3), pad=(1, 1), name=('%s_double_3x3_0' % name))
    cd3x3 = ConvFactory(data=cd3x3, num_filter=num_d3x3, kernel=(3, 3), pad=(1, 1), name=('%s_double_3x3_1' % name))
    # pool + proj
    pooling = mx.symbol.Pooling(data=data, kernel=(3, 3), stride=(1, 1), pad=(1, 1), pool_type=pool, name=('%s_pool_%s_pool' % (pool, name)))
    cproj = ConvFactory(data=pooling, num_filter=proj, kernel=(1, 1), name=('%s_proj' %  name))
    # concat
    concat = mx.symbol.Concat(*[c1x1, c3x3, cd3x3, cproj], name='ch_concat_%s_chconcat' % name)
    return concat

In [29]:
# We can also visualize network with feature map shape information
# In this case, we must provide all necessary input shape info as a dict
prev = mx.symbol.Variable(name="Previos Output")
in3a = InceptionFactoryA(prev, 64, 64, 64, 64, 96, "avg", 32, name="in3a")
# shape info
# Note shape info must contain batch size although we ignore batch size in graph to save space
batch_size = 128
shape = {"Previos Output" : (batch_size, 3, 28, 28)}
# plot
mx.viz.plot_network(symbol=in3a, shape=shape)


Out[29]:
plot Previos Output Previos Output conv_in3a_1x1 Convolution 1x1/1, 64 conv_in3a_1x1->Previos Output 3x28x28 bn_in3a_1x1 BatchNorm bn_in3a_1x1->conv_in3a_1x1 64x28x28 relu_in3a_1x1 Activation relu relu_in3a_1x1->bn_in3a_1x1 64x28x28 conv_in3a_3x3_reduce Convolution 1x1/1, 64 conv_in3a_3x3_reduce->Previos Output 3x28x28 bn_in3a_3x3_reduce BatchNorm bn_in3a_3x3_reduce->conv_in3a_3x3_reduce 64x28x28 relu_in3a_3x3_reduce Activation relu relu_in3a_3x3_reduce->bn_in3a_3x3_reduce 64x28x28 conv_in3a_3x3 Convolution 3x3/1, 64 conv_in3a_3x3->relu_in3a_3x3_reduce 64x28x28 bn_in3a_3x3 BatchNorm bn_in3a_3x3->conv_in3a_3x3 64x28x28 relu_in3a_3x3 Activation relu relu_in3a_3x3->bn_in3a_3x3 64x28x28 conv_in3a_double_3x3_reduce Convolution 1x1/1, 64 conv_in3a_double_3x3_reduce->Previos Output 3x28x28 bn_in3a_double_3x3_reduce BatchNorm bn_in3a_double_3x3_reduce->conv_in3a_double_3x3_reduce 64x28x28 relu_in3a_double_3x3_reduce Activation relu relu_in3a_double_3x3_reduce->bn_in3a_double_3x3_reduce 64x28x28 conv_in3a_double_3x3_0 Convolution 3x3/1, 96 conv_in3a_double_3x3_0->relu_in3a_double_3x3_reduce 64x28x28 bn_in3a_double_3x3_0 BatchNorm bn_in3a_double_3x3_0->conv_in3a_double_3x3_0 96x28x28 relu_in3a_double_3x3_0 Activation relu relu_in3a_double_3x3_0->bn_in3a_double_3x3_0 96x28x28 conv_in3a_double_3x3_1 Convolution 3x3/1, 96 conv_in3a_double_3x3_1->relu_in3a_double_3x3_0 96x28x28 bn_in3a_double_3x3_1 BatchNorm bn_in3a_double_3x3_1->conv_in3a_double_3x3_1 96x28x28 relu_in3a_double_3x3_1 Activation relu relu_in3a_double_3x3_1->bn_in3a_double_3x3_1 96x28x28 avg_pool_in3a_pool Pooling avg, 3x3/1 avg_pool_in3a_pool->Previos Output 3x28x28 conv_in3a_proj Convolution 1x1/1, 32 conv_in3a_proj->avg_pool_in3a_pool 3x28x28 bn_in3a_proj BatchNorm bn_in3a_proj->conv_in3a_proj 32x28x28 relu_in3a_proj Activation relu relu_in3a_proj->bn_in3a_proj 32x28x28 ch_concat_in3a_chconcat Concat ch_concat_in3a_chconcat->relu_in3a_1x1 64x28x28 ch_concat_in3a_chconcat->relu_in3a_3x3 64x28x28 ch_concat_in3a_chconcat->relu_in3a_double_3x3_1 96x28x28 ch_concat_in3a_chconcat->relu_in3a_proj 32x28x28

We will make the other factory with stride=(2, 2)


In [30]:
# param mapping to paper:
# num_1x1      >>>  #1x1 (not exist!)
# num_3x3red   >>>  #3x3 reduce
# num_3x3      >>>  #3x3
# num_d3x3red  >>>  double #3x3 reduce
# num_d3x3     >>>  double #3x3
# pool         >>>  Pool (not needed, all are max pooling)
# proj         >>>  proj (not exist!)
def InceptionFactoryB(data, num_3x3red, num_3x3, num_d3x3red, num_d3x3, name):
    # 3x3 reduce + 3x3
    c3x3r = ConvFactory(data=data, num_filter=num_3x3red, kernel=(1, 1), name=('%s_3x3' % name), suffix='_reduce')
    c3x3 = ConvFactory(data=c3x3r, num_filter=num_3x3, kernel=(3, 3), pad=(1, 1), stride=(2, 2), name=('%s_3x3' % name))
    # double 3x3 reduce + double 3x3
    cd3x3r = ConvFactory(data=data, num_filter=num_d3x3red, kernel=(1, 1),  name=('%s_double_3x3' % name), suffix='_reduce')
    cd3x3 = ConvFactory(data=cd3x3r, num_filter=num_d3x3, kernel=(3, 3), pad=(1, 1), stride=(1, 1), name=('%s_double_3x3_0' % name))
    cd3x3 = ConvFactory(data=cd3x3, num_filter=num_d3x3, kernel=(3, 3), pad=(1, 1), stride=(2, 2), name=('%s_double_3x3_1' % name))
    # pool + proj
    pooling = mx.symbol.Pooling(data=data, kernel=(3, 3), stride=(2, 2), pad=(1, 1), pool_type="max", name=('max_pool_%s_pool' % name))
    # concat
    concat = mx.symbol.Concat(*[c3x3, cd3x3, pooling], name='ch_concat_%s_chconcat' % name)
    return concat

In [31]:
prev = mx.symbol.Variable(name="Previos Output")
in3c = InceptionFactoryB(prev, 128, 160, 64, 96, name='in3c')
mx.viz.plot_network(symbol=in3c)


Out[31]:
plot Previos Output Previos Output conv_in3c_3x3_reduce Convolution 1x1/1, 128 conv_in3c_3x3_reduce->Previos Output bn_in3c_3x3_reduce BatchNorm bn_in3c_3x3_reduce->conv_in3c_3x3_reduce relu_in3c_3x3_reduce Activation relu relu_in3c_3x3_reduce->bn_in3c_3x3_reduce conv_in3c_3x3 Convolution 3x3/2, 160 conv_in3c_3x3->relu_in3c_3x3_reduce bn_in3c_3x3 BatchNorm bn_in3c_3x3->conv_in3c_3x3 relu_in3c_3x3 Activation relu relu_in3c_3x3->bn_in3c_3x3 conv_in3c_double_3x3_reduce Convolution 1x1/1, 64 conv_in3c_double_3x3_reduce->Previos Output bn_in3c_double_3x3_reduce BatchNorm bn_in3c_double_3x3_reduce->conv_in3c_double_3x3_reduce relu_in3c_double_3x3_reduce Activation relu relu_in3c_double_3x3_reduce->bn_in3c_double_3x3_reduce conv_in3c_double_3x3_0 Convolution 3x3/1, 96 conv_in3c_double_3x3_0->relu_in3c_double_3x3_reduce bn_in3c_double_3x3_0 BatchNorm bn_in3c_double_3x3_0->conv_in3c_double_3x3_0 relu_in3c_double_3x3_0 Activation relu relu_in3c_double_3x3_0->bn_in3c_double_3x3_0 conv_in3c_double_3x3_1 Convolution 3x3/2, 96 conv_in3c_double_3x3_1->relu_in3c_double_3x3_0 bn_in3c_double_3x3_1 BatchNorm bn_in3c_double_3x3_1->conv_in3c_double_3x3_1 relu_in3c_double_3x3_1 Activation relu relu_in3c_double_3x3_1->bn_in3c_double_3x3_1 max_pool_in3c_pool Pooling max, 3x3/2 max_pool_in3c_pool->Previos Output ch_concat_in3c_chconcat Concat ch_concat_in3c_chconcat->relu_in3c_3x3 ch_concat_in3c_chconcat->relu_in3c_double_3x3_1 ch_concat_in3c_chconcat->max_pool_in3c_pool

Now we can use these factories to build the whole network


In [32]:
# data
data = mx.symbol.Variable(name="data")
# stage 1
conv1 = ConvFactory(data=data, num_filter=64, kernel=(7, 7), stride=(2, 2), pad=(3, 3), name='1')
pool1 = mx.symbol.Pooling(data=conv1, kernel=(3, 3), stride=(2, 2), name='pool_1', pool_type='max')
# stage 2
conv2red = ConvFactory(data=pool1, num_filter=64, kernel=(1, 1), stride=(1, 1), name='2_red')
conv2 = ConvFactory(data=conv2red, num_filter=192, kernel=(3, 3), stride=(1, 1), pad=(1, 1), name='2')
pool2 = mx.symbol.Pooling(data=conv2, kernel=(3, 3), stride=(2, 2), name='pool_2', pool_type='max')
# stage 2
in3a = InceptionFactoryA(pool2, 64, 64, 64, 64, 96, "avg", 32, '3a')
in3b = InceptionFactoryA(in3a, 64, 64, 96, 64, 96, "avg", 64, '3b')
in3c = InceptionFactoryB(in3b, 128, 160, 64, 96, '3c')
# stage 3
in4a = InceptionFactoryA(in3c, 224, 64, 96, 96, 128, "avg", 128, '4a')
in4b = InceptionFactoryA(in4a, 192, 96, 128, 96, 128, "avg", 128, '4b')
in4c = InceptionFactoryA(in4b, 160, 128, 160, 128, 160, "avg", 128, '4c')
in4d = InceptionFactoryA(in4c, 96, 128, 192, 160, 192, "avg", 128, '4d')
in4e = InceptionFactoryB(in4d, 128, 192, 192, 256, '4e')
# stage 4
in5a = InceptionFactoryA(in4e, 352, 192, 320, 160, 224, "avg", 128, '5a')
in5b = InceptionFactoryA(in5a, 352, 192, 320, 192, 224, "max", 128, '5b')
# global avg pooling
avg = mx.symbol.Pooling(data=in5b, kernel=(7, 7), stride=(1, 1), name="global_pool", pool_type='avg')
# linear classifier
flatten = mx.symbol.Flatten(data=avg, name='flatten')
fc1 = mx.symbol.FullyConnected(data=flatten, num_hidden=1000, name='fc1')
softmax = mx.symbol.SoftmaxOutput(data=fc1, name='softmax')

# if you like, you can visualize full network structure
mx.viz.plot_network(symbol=softmax, shape={"data" : (128, 3, 224, 224)})


Out[32]:
plot data data conv_1 Convolution 7x7/2, 64 conv_1->data 3x224x224 bn_1 BatchNorm bn_1->conv_1 64x112x112 relu_1 Activation relu relu_1->bn_1 64x112x112 pool_1 Pooling max, 3x3/2 pool_1->relu_1 64x112x112 conv_2_red Convolution 1x1/1, 64 conv_2_red->pool_1 64x55x55 bn_2_red BatchNorm bn_2_red->conv_2_red 64x55x55 relu_2_red Activation relu relu_2_red->bn_2_red 64x55x55 conv_2 Convolution 3x3/1, 192 conv_2->relu_2_red 64x55x55 bn_2 BatchNorm bn_2->conv_2 192x55x55 relu_2 Activation relu relu_2->bn_2 192x55x55 pool_2 Pooling max, 3x3/2 pool_2->relu_2 192x55x55 conv_3a_1x1 Convolution 1x1/1, 64 conv_3a_1x1->pool_2 192x27x27 bn_3a_1x1 BatchNorm bn_3a_1x1->conv_3a_1x1 64x27x27 relu_3a_1x1 Activation relu relu_3a_1x1->bn_3a_1x1 64x27x27 conv_3a_3x3_reduce Convolution 1x1/1, 64 conv_3a_3x3_reduce->pool_2 192x27x27 bn_3a_3x3_reduce BatchNorm bn_3a_3x3_reduce->conv_3a_3x3_reduce 64x27x27 relu_3a_3x3_reduce Activation relu relu_3a_3x3_reduce->bn_3a_3x3_reduce 64x27x27 conv_3a_3x3 Convolution 3x3/1, 64 conv_3a_3x3->relu_3a_3x3_reduce 64x27x27 bn_3a_3x3 BatchNorm bn_3a_3x3->conv_3a_3x3 64x27x27 relu_3a_3x3 Activation relu relu_3a_3x3->bn_3a_3x3 64x27x27 conv_3a_double_3x3_reduce Convolution 1x1/1, 64 conv_3a_double_3x3_reduce->pool_2 192x27x27 bn_3a_double_3x3_reduce BatchNorm bn_3a_double_3x3_reduce->conv_3a_double_3x3_reduce 64x27x27 relu_3a_double_3x3_reduce Activation relu relu_3a_double_3x3_reduce->bn_3a_double_3x3_reduce 64x27x27 conv_3a_double_3x3_0 Convolution 3x3/1, 96 conv_3a_double_3x3_0->relu_3a_double_3x3_reduce 64x27x27 bn_3a_double_3x3_0 BatchNorm bn_3a_double_3x3_0->conv_3a_double_3x3_0 96x27x27 relu_3a_double_3x3_0 Activation relu relu_3a_double_3x3_0->bn_3a_double_3x3_0 96x27x27 conv_3a_double_3x3_1 Convolution 3x3/1, 96 conv_3a_double_3x3_1->relu_3a_double_3x3_0 96x27x27 bn_3a_double_3x3_1 BatchNorm bn_3a_double_3x3_1->conv_3a_double_3x3_1 96x27x27 relu_3a_double_3x3_1 Activation relu relu_3a_double_3x3_1->bn_3a_double_3x3_1 96x27x27 avg_pool_3a_pool Pooling avg, 3x3/1 avg_pool_3a_pool->pool_2 192x27x27 conv_3a_proj Convolution 1x1/1, 32 conv_3a_proj->avg_pool_3a_pool 192x27x27 bn_3a_proj BatchNorm bn_3a_proj->conv_3a_proj 32x27x27 relu_3a_proj Activation relu relu_3a_proj->bn_3a_proj 32x27x27 ch_concat_3a_chconcat Concat ch_concat_3a_chconcat->relu_3a_1x1 64x27x27 ch_concat_3a_chconcat->relu_3a_3x3 64x27x27 ch_concat_3a_chconcat->relu_3a_double_3x3_1 96x27x27 ch_concat_3a_chconcat->relu_3a_proj 32x27x27 conv_3b_1x1 Convolution 1x1/1, 64 conv_3b_1x1->ch_concat_3a_chconcat 256x27x27 bn_3b_1x1 BatchNorm bn_3b_1x1->conv_3b_1x1 64x27x27 relu_3b_1x1 Activation relu relu_3b_1x1->bn_3b_1x1 64x27x27 conv_3b_3x3_reduce Convolution 1x1/1, 64 conv_3b_3x3_reduce->ch_concat_3a_chconcat 256x27x27 bn_3b_3x3_reduce BatchNorm bn_3b_3x3_reduce->conv_3b_3x3_reduce 64x27x27 relu_3b_3x3_reduce Activation relu relu_3b_3x3_reduce->bn_3b_3x3_reduce 64x27x27 conv_3b_3x3 Convolution 3x3/1, 96 conv_3b_3x3->relu_3b_3x3_reduce 64x27x27 bn_3b_3x3 BatchNorm bn_3b_3x3->conv_3b_3x3 96x27x27 relu_3b_3x3 Activation relu relu_3b_3x3->bn_3b_3x3 96x27x27 conv_3b_double_3x3_reduce Convolution 1x1/1, 64 conv_3b_double_3x3_reduce->ch_concat_3a_chconcat 256x27x27 bn_3b_double_3x3_reduce BatchNorm bn_3b_double_3x3_reduce->conv_3b_double_3x3_reduce 64x27x27 relu_3b_double_3x3_reduce Activation relu relu_3b_double_3x3_reduce->bn_3b_double_3x3_reduce 64x27x27 conv_3b_double_3x3_0 Convolution 3x3/1, 96 conv_3b_double_3x3_0->relu_3b_double_3x3_reduce 64x27x27 bn_3b_double_3x3_0 BatchNorm bn_3b_double_3x3_0->conv_3b_double_3x3_0 96x27x27 relu_3b_double_3x3_0 Activation relu relu_3b_double_3x3_0->bn_3b_double_3x3_0 96x27x27 conv_3b_double_3x3_1 Convolution 3x3/1, 96 conv_3b_double_3x3_1->relu_3b_double_3x3_0 96x27x27 bn_3b_double_3x3_1 BatchNorm bn_3b_double_3x3_1->conv_3b_double_3x3_1 96x27x27 relu_3b_double_3x3_1 Activation relu relu_3b_double_3x3_1->bn_3b_double_3x3_1 96x27x27 avg_pool_3b_pool Pooling avg, 3x3/1 avg_pool_3b_pool->ch_concat_3a_chconcat 256x27x27 conv_3b_proj Convolution 1x1/1, 64 conv_3b_proj->avg_pool_3b_pool 256x27x27 bn_3b_proj BatchNorm bn_3b_proj->conv_3b_proj 64x27x27 relu_3b_proj Activation relu relu_3b_proj->bn_3b_proj 64x27x27 ch_concat_3b_chconcat Concat ch_concat_3b_chconcat->relu_3b_1x1 64x27x27 ch_concat_3b_chconcat->relu_3b_3x3 96x27x27 ch_concat_3b_chconcat->relu_3b_double_3x3_1 96x27x27 ch_concat_3b_chconcat->relu_3b_proj 64x27x27 conv_3c_3x3_reduce Convolution 1x1/1, 128 conv_3c_3x3_reduce->ch_concat_3b_chconcat 320x27x27 bn_3c_3x3_reduce BatchNorm bn_3c_3x3_reduce->conv_3c_3x3_reduce 128x27x27 relu_3c_3x3_reduce Activation relu relu_3c_3x3_reduce->bn_3c_3x3_reduce 128x27x27 conv_3c_3x3 Convolution 3x3/2, 160 conv_3c_3x3->relu_3c_3x3_reduce 128x27x27 bn_3c_3x3 BatchNorm bn_3c_3x3->conv_3c_3x3 160x14x14 relu_3c_3x3 Activation relu relu_3c_3x3->bn_3c_3x3 160x14x14 conv_3c_double_3x3_reduce Convolution 1x1/1, 64 conv_3c_double_3x3_reduce->ch_concat_3b_chconcat 320x27x27 bn_3c_double_3x3_reduce BatchNorm bn_3c_double_3x3_reduce->conv_3c_double_3x3_reduce 64x27x27 relu_3c_double_3x3_reduce Activation relu relu_3c_double_3x3_reduce->bn_3c_double_3x3_reduce 64x27x27 conv_3c_double_3x3_0 Convolution 3x3/1, 96 conv_3c_double_3x3_0->relu_3c_double_3x3_reduce 64x27x27 bn_3c_double_3x3_0 BatchNorm bn_3c_double_3x3_0->conv_3c_double_3x3_0 96x27x27 relu_3c_double_3x3_0 Activation relu relu_3c_double_3x3_0->bn_3c_double_3x3_0 96x27x27 conv_3c_double_3x3_1 Convolution 3x3/2, 96 conv_3c_double_3x3_1->relu_3c_double_3x3_0 96x27x27 bn_3c_double_3x3_1 BatchNorm bn_3c_double_3x3_1->conv_3c_double_3x3_1 96x14x14 relu_3c_double_3x3_1 Activation relu relu_3c_double_3x3_1->bn_3c_double_3x3_1 96x14x14 max_pool_3c_pool Pooling max, 3x3/2 max_pool_3c_pool->ch_concat_3b_chconcat 320x27x27 ch_concat_3c_chconcat Concat ch_concat_3c_chconcat->relu_3c_3x3 160x14x14 ch_concat_3c_chconcat->relu_3c_double_3x3_1 96x14x14 ch_concat_3c_chconcat->max_pool_3c_pool 320x14x14 conv_4a_1x1 Convolution 1x1/1, 224 conv_4a_1x1->ch_concat_3c_chconcat 576x14x14 bn_4a_1x1 BatchNorm bn_4a_1x1->conv_4a_1x1 224x14x14 relu_4a_1x1 Activation relu relu_4a_1x1->bn_4a_1x1 224x14x14 conv_4a_3x3_reduce Convolution 1x1/1, 64 conv_4a_3x3_reduce->ch_concat_3c_chconcat 576x14x14 bn_4a_3x3_reduce BatchNorm bn_4a_3x3_reduce->conv_4a_3x3_reduce 64x14x14 relu_4a_3x3_reduce Activation relu relu_4a_3x3_reduce->bn_4a_3x3_reduce 64x14x14 conv_4a_3x3 Convolution 3x3/1, 96 conv_4a_3x3->relu_4a_3x3_reduce 64x14x14 bn_4a_3x3 BatchNorm bn_4a_3x3->conv_4a_3x3 96x14x14 relu_4a_3x3 Activation relu relu_4a_3x3->bn_4a_3x3 96x14x14 conv_4a_double_3x3_reduce Convolution 1x1/1, 96 conv_4a_double_3x3_reduce->ch_concat_3c_chconcat 576x14x14 bn_4a_double_3x3_reduce BatchNorm bn_4a_double_3x3_reduce->conv_4a_double_3x3_reduce 96x14x14 relu_4a_double_3x3_reduce Activation relu relu_4a_double_3x3_reduce->bn_4a_double_3x3_reduce 96x14x14 conv_4a_double_3x3_0 Convolution 3x3/1, 128 conv_4a_double_3x3_0->relu_4a_double_3x3_reduce 96x14x14 bn_4a_double_3x3_0 BatchNorm bn_4a_double_3x3_0->conv_4a_double_3x3_0 128x14x14 relu_4a_double_3x3_0 Activation relu relu_4a_double_3x3_0->bn_4a_double_3x3_0 128x14x14 conv_4a_double_3x3_1 Convolution 3x3/1, 128 conv_4a_double_3x3_1->relu_4a_double_3x3_0 128x14x14 bn_4a_double_3x3_1 BatchNorm bn_4a_double_3x3_1->conv_4a_double_3x3_1 128x14x14 relu_4a_double_3x3_1 Activation relu relu_4a_double_3x3_1->bn_4a_double_3x3_1 128x14x14 avg_pool_4a_pool Pooling avg, 3x3/1 avg_pool_4a_pool->ch_concat_3c_chconcat 576x14x14 conv_4a_proj Convolution 1x1/1, 128 conv_4a_proj->avg_pool_4a_pool 576x14x14 bn_4a_proj BatchNorm bn_4a_proj->conv_4a_proj 128x14x14 relu_4a_proj Activation relu relu_4a_proj->bn_4a_proj 128x14x14 ch_concat_4a_chconcat Concat ch_concat_4a_chconcat->relu_4a_1x1 224x14x14 ch_concat_4a_chconcat->relu_4a_3x3 96x14x14 ch_concat_4a_chconcat->relu_4a_double_3x3_1 128x14x14 ch_concat_4a_chconcat->relu_4a_proj 128x14x14 conv_4b_1x1 Convolution 1x1/1, 192 conv_4b_1x1->ch_concat_4a_chconcat 576x14x14 bn_4b_1x1 BatchNorm bn_4b_1x1->conv_4b_1x1 192x14x14 relu_4b_1x1 Activation relu relu_4b_1x1->bn_4b_1x1 192x14x14 conv_4b_3x3_reduce Convolution 1x1/1, 96 conv_4b_3x3_reduce->ch_concat_4a_chconcat 576x14x14 bn_4b_3x3_reduce BatchNorm bn_4b_3x3_reduce->conv_4b_3x3_reduce 96x14x14 relu_4b_3x3_reduce Activation relu relu_4b_3x3_reduce->bn_4b_3x3_reduce 96x14x14 conv_4b_3x3 Convolution 3x3/1, 128 conv_4b_3x3->relu_4b_3x3_reduce 96x14x14 bn_4b_3x3 BatchNorm bn_4b_3x3->conv_4b_3x3 128x14x14 relu_4b_3x3 Activation relu relu_4b_3x3->bn_4b_3x3 128x14x14 conv_4b_double_3x3_reduce Convolution 1x1/1, 96 conv_4b_double_3x3_reduce->ch_concat_4a_chconcat 576x14x14 bn_4b_double_3x3_reduce BatchNorm bn_4b_double_3x3_reduce->conv_4b_double_3x3_reduce 96x14x14 relu_4b_double_3x3_reduce Activation relu relu_4b_double_3x3_reduce->bn_4b_double_3x3_reduce 96x14x14 conv_4b_double_3x3_0 Convolution 3x3/1, 128 conv_4b_double_3x3_0->relu_4b_double_3x3_reduce 96x14x14 bn_4b_double_3x3_0 BatchNorm bn_4b_double_3x3_0->conv_4b_double_3x3_0 128x14x14 relu_4b_double_3x3_0 Activation relu relu_4b_double_3x3_0->bn_4b_double_3x3_0 128x14x14 conv_4b_double_3x3_1 Convolution 3x3/1, 128 conv_4b_double_3x3_1->relu_4b_double_3x3_0 128x14x14 bn_4b_double_3x3_1 BatchNorm bn_4b_double_3x3_1->conv_4b_double_3x3_1 128x14x14 relu_4b_double_3x3_1 Activation relu relu_4b_double_3x3_1->bn_4b_double_3x3_1 128x14x14 avg_pool_4b_pool Pooling avg, 3x3/1 avg_pool_4b_pool->ch_concat_4a_chconcat 576x14x14 conv_4b_proj Convolution 1x1/1, 128 conv_4b_proj->avg_pool_4b_pool 576x14x14 bn_4b_proj BatchNorm bn_4b_proj->conv_4b_proj 128x14x14 relu_4b_proj Activation relu relu_4b_proj->bn_4b_proj 128x14x14 ch_concat_4b_chconcat Concat ch_concat_4b_chconcat->relu_4b_1x1 192x14x14 ch_concat_4b_chconcat->relu_4b_3x3 128x14x14 ch_concat_4b_chconcat->relu_4b_double_3x3_1 128x14x14 ch_concat_4b_chconcat->relu_4b_proj 128x14x14 conv_4c_1x1 Convolution 1x1/1, 160 conv_4c_1x1->ch_concat_4b_chconcat 576x14x14 bn_4c_1x1 BatchNorm bn_4c_1x1->conv_4c_1x1 160x14x14 relu_4c_1x1 Activation relu relu_4c_1x1->bn_4c_1x1 160x14x14 conv_4c_3x3_reduce Convolution 1x1/1, 128 conv_4c_3x3_reduce->ch_concat_4b_chconcat 576x14x14 bn_4c_3x3_reduce BatchNorm bn_4c_3x3_reduce->conv_4c_3x3_reduce 128x14x14 relu_4c_3x3_reduce Activation relu relu_4c_3x3_reduce->bn_4c_3x3_reduce 128x14x14 conv_4c_3x3 Convolution 3x3/1, 160 conv_4c_3x3->relu_4c_3x3_reduce 128x14x14 bn_4c_3x3 BatchNorm bn_4c_3x3->conv_4c_3x3 160x14x14 relu_4c_3x3 Activation relu relu_4c_3x3->bn_4c_3x3 160x14x14 conv_4c_double_3x3_reduce Convolution 1x1/1, 128 conv_4c_double_3x3_reduce->ch_concat_4b_chconcat 576x14x14 bn_4c_double_3x3_reduce BatchNorm bn_4c_double_3x3_reduce->conv_4c_double_3x3_reduce 128x14x14 relu_4c_double_3x3_reduce Activation relu relu_4c_double_3x3_reduce->bn_4c_double_3x3_reduce 128x14x14 conv_4c_double_3x3_0 Convolution 3x3/1, 160 conv_4c_double_3x3_0->relu_4c_double_3x3_reduce 128x14x14 bn_4c_double_3x3_0 BatchNorm bn_4c_double_3x3_0->conv_4c_double_3x3_0 160x14x14 relu_4c_double_3x3_0 Activation relu relu_4c_double_3x3_0->bn_4c_double_3x3_0 160x14x14 conv_4c_double_3x3_1 Convolution 3x3/1, 160 conv_4c_double_3x3_1->relu_4c_double_3x3_0 160x14x14 bn_4c_double_3x3_1 BatchNorm bn_4c_double_3x3_1->conv_4c_double_3x3_1 160x14x14 relu_4c_double_3x3_1 Activation relu relu_4c_double_3x3_1->bn_4c_double_3x3_1 160x14x14 avg_pool_4c_pool Pooling avg, 3x3/1 avg_pool_4c_pool->ch_concat_4b_chconcat 576x14x14 conv_4c_proj Convolution 1x1/1, 128 conv_4c_proj->avg_pool_4c_pool 576x14x14 bn_4c_proj BatchNorm bn_4c_proj->conv_4c_proj 128x14x14 relu_4c_proj Activation relu relu_4c_proj->bn_4c_proj 128x14x14 ch_concat_4c_chconcat Concat ch_concat_4c_chconcat->relu_4c_1x1 160x14x14 ch_concat_4c_chconcat->relu_4c_3x3 160x14x14 ch_concat_4c_chconcat->relu_4c_double_3x3_1 160x14x14 ch_concat_4c_chconcat->relu_4c_proj 128x14x14 conv_4d_1x1 Convolution 1x1/1, 96 conv_4d_1x1->ch_concat_4c_chconcat 608x14x14 bn_4d_1x1 BatchNorm bn_4d_1x1->conv_4d_1x1 96x14x14 relu_4d_1x1 Activation relu relu_4d_1x1->bn_4d_1x1 96x14x14 conv_4d_3x3_reduce Convolution 1x1/1, 128 conv_4d_3x3_reduce->ch_concat_4c_chconcat 608x14x14 bn_4d_3x3_reduce BatchNorm bn_4d_3x3_reduce->conv_4d_3x3_reduce 128x14x14 relu_4d_3x3_reduce Activation relu relu_4d_3x3_reduce->bn_4d_3x3_reduce 128x14x14 conv_4d_3x3 Convolution 3x3/1, 192 conv_4d_3x3->relu_4d_3x3_reduce 128x14x14 bn_4d_3x3 BatchNorm bn_4d_3x3->conv_4d_3x3 192x14x14 relu_4d_3x3 Activation relu relu_4d_3x3->bn_4d_3x3 192x14x14 conv_4d_double_3x3_reduce Convolution 1x1/1, 160 conv_4d_double_3x3_reduce->ch_concat_4c_chconcat 608x14x14 bn_4d_double_3x3_reduce BatchNorm bn_4d_double_3x3_reduce->conv_4d_double_3x3_reduce 160x14x14 relu_4d_double_3x3_reduce Activation relu relu_4d_double_3x3_reduce->bn_4d_double_3x3_reduce 160x14x14 conv_4d_double_3x3_0 Convolution 3x3/1, 192 conv_4d_double_3x3_0->relu_4d_double_3x3_reduce 160x14x14 bn_4d_double_3x3_0 BatchNorm bn_4d_double_3x3_0->conv_4d_double_3x3_0 192x14x14 relu_4d_double_3x3_0 Activation relu relu_4d_double_3x3_0->bn_4d_double_3x3_0 192x14x14 conv_4d_double_3x3_1 Convolution 3x3/1, 192 conv_4d_double_3x3_1->relu_4d_double_3x3_0 192x14x14 bn_4d_double_3x3_1 BatchNorm bn_4d_double_3x3_1->conv_4d_double_3x3_1 192x14x14 relu_4d_double_3x3_1 Activation relu relu_4d_double_3x3_1->bn_4d_double_3x3_1 192x14x14 avg_pool_4d_pool Pooling avg, 3x3/1 avg_pool_4d_pool->ch_concat_4c_chconcat 608x14x14 conv_4d_proj Convolution 1x1/1, 128 conv_4d_proj->avg_pool_4d_pool 608x14x14 bn_4d_proj BatchNorm bn_4d_proj->conv_4d_proj 128x14x14 relu_4d_proj Activation relu relu_4d_proj->bn_4d_proj 128x14x14 ch_concat_4d_chconcat Concat ch_concat_4d_chconcat->relu_4d_1x1 96x14x14 ch_concat_4d_chconcat->relu_4d_3x3 192x14x14 ch_concat_4d_chconcat->relu_4d_double_3x3_1 192x14x14 ch_concat_4d_chconcat->relu_4d_proj 128x14x14 conv_4e_3x3_reduce Convolution 1x1/1, 128 conv_4e_3x3_reduce->ch_concat_4d_chconcat 608x14x14 bn_4e_3x3_reduce BatchNorm bn_4e_3x3_reduce->conv_4e_3x3_reduce 128x14x14 relu_4e_3x3_reduce Activation relu relu_4e_3x3_reduce->bn_4e_3x3_reduce 128x14x14 conv_4e_3x3 Convolution 3x3/2, 192 conv_4e_3x3->relu_4e_3x3_reduce 128x14x14 bn_4e_3x3 BatchNorm bn_4e_3x3->conv_4e_3x3 192x7x7 relu_4e_3x3 Activation relu relu_4e_3x3->bn_4e_3x3 192x7x7 conv_4e_double_3x3_reduce Convolution 1x1/1, 192 conv_4e_double_3x3_reduce->ch_concat_4d_chconcat 608x14x14 bn_4e_double_3x3_reduce BatchNorm bn_4e_double_3x3_reduce->conv_4e_double_3x3_reduce 192x14x14 relu_4e_double_3x3_reduce Activation relu relu_4e_double_3x3_reduce->bn_4e_double_3x3_reduce 192x14x14 conv_4e_double_3x3_0 Convolution 3x3/1, 256 conv_4e_double_3x3_0->relu_4e_double_3x3_reduce 192x14x14 bn_4e_double_3x3_0 BatchNorm bn_4e_double_3x3_0->conv_4e_double_3x3_0 256x14x14 relu_4e_double_3x3_0 Activation relu relu_4e_double_3x3_0->bn_4e_double_3x3_0 256x14x14 conv_4e_double_3x3_1 Convolution 3x3/2, 256 conv_4e_double_3x3_1->relu_4e_double_3x3_0 256x14x14 bn_4e_double_3x3_1 BatchNorm bn_4e_double_3x3_1->conv_4e_double_3x3_1 256x7x7 relu_4e_double_3x3_1 Activation relu relu_4e_double_3x3_1->bn_4e_double_3x3_1 256x7x7 max_pool_4e_pool Pooling max, 3x3/2 max_pool_4e_pool->ch_concat_4d_chconcat 608x14x14 ch_concat_4e_chconcat Concat ch_concat_4e_chconcat->relu_4e_3x3 192x7x7 ch_concat_4e_chconcat->relu_4e_double_3x3_1 256x7x7 ch_concat_4e_chconcat->max_pool_4e_pool 608x7x7 conv_5a_1x1 Convolution 1x1/1, 352 conv_5a_1x1->ch_concat_4e_chconcat 1056x7x7 bn_5a_1x1 BatchNorm bn_5a_1x1->conv_5a_1x1 352x7x7 relu_5a_1x1 Activation relu relu_5a_1x1->bn_5a_1x1 352x7x7 conv_5a_3x3_reduce Convolution 1x1/1, 192 conv_5a_3x3_reduce->ch_concat_4e_chconcat 1056x7x7 bn_5a_3x3_reduce BatchNorm bn_5a_3x3_reduce->conv_5a_3x3_reduce 192x7x7 relu_5a_3x3_reduce Activation relu relu_5a_3x3_reduce->bn_5a_3x3_reduce 192x7x7 conv_5a_3x3 Convolution 3x3/1, 320 conv_5a_3x3->relu_5a_3x3_reduce 192x7x7 bn_5a_3x3 BatchNorm bn_5a_3x3->conv_5a_3x3 320x7x7 relu_5a_3x3 Activation relu relu_5a_3x3->bn_5a_3x3 320x7x7 conv_5a_double_3x3_reduce Convolution 1x1/1, 160 conv_5a_double_3x3_reduce->ch_concat_4e_chconcat 1056x7x7 bn_5a_double_3x3_reduce BatchNorm bn_5a_double_3x3_reduce->conv_5a_double_3x3_reduce 160x7x7 relu_5a_double_3x3_reduce Activation relu relu_5a_double_3x3_reduce->bn_5a_double_3x3_reduce 160x7x7 conv_5a_double_3x3_0 Convolution 3x3/1, 224 conv_5a_double_3x3_0->relu_5a_double_3x3_reduce 160x7x7 bn_5a_double_3x3_0 BatchNorm bn_5a_double_3x3_0->conv_5a_double_3x3_0 224x7x7 relu_5a_double_3x3_0 Activation relu relu_5a_double_3x3_0->bn_5a_double_3x3_0 224x7x7 conv_5a_double_3x3_1 Convolution 3x3/1, 224 conv_5a_double_3x3_1->relu_5a_double_3x3_0 224x7x7 bn_5a_double_3x3_1 BatchNorm bn_5a_double_3x3_1->conv_5a_double_3x3_1 224x7x7 relu_5a_double_3x3_1 Activation relu relu_5a_double_3x3_1->bn_5a_double_3x3_1 224x7x7 avg_pool_5a_pool Pooling avg, 3x3/1 avg_pool_5a_pool->ch_concat_4e_chconcat 1056x7x7 conv_5a_proj Convolution 1x1/1, 128 conv_5a_proj->avg_pool_5a_pool 1056x7x7 bn_5a_proj BatchNorm bn_5a_proj->conv_5a_proj 128x7x7 relu_5a_proj Activation relu relu_5a_proj->bn_5a_proj 128x7x7 ch_concat_5a_chconcat Concat ch_concat_5a_chconcat->relu_5a_1x1 352x7x7 ch_concat_5a_chconcat->relu_5a_3x3 320x7x7 ch_concat_5a_chconcat->relu_5a_double_3x3_1 224x7x7 ch_concat_5a_chconcat->relu_5a_proj 128x7x7 conv_5b_1x1 Convolution 1x1/1, 352 conv_5b_1x1->ch_concat_5a_chconcat 1024x7x7 bn_5b_1x1 BatchNorm bn_5b_1x1->conv_5b_1x1 352x7x7 relu_5b_1x1 Activation relu relu_5b_1x1->bn_5b_1x1 352x7x7 conv_5b_3x3_reduce Convolution 1x1/1, 192 conv_5b_3x3_reduce->ch_concat_5a_chconcat 1024x7x7 bn_5b_3x3_reduce BatchNorm bn_5b_3x3_reduce->conv_5b_3x3_reduce 192x7x7 relu_5b_3x3_reduce Activation relu relu_5b_3x3_reduce->bn_5b_3x3_reduce 192x7x7 conv_5b_3x3 Convolution 3x3/1, 320 conv_5b_3x3->relu_5b_3x3_reduce 192x7x7 bn_5b_3x3 BatchNorm bn_5b_3x3->conv_5b_3x3 320x7x7 relu_5b_3x3 Activation relu relu_5b_3x3->bn_5b_3x3 320x7x7 conv_5b_double_3x3_reduce Convolution 1x1/1, 192 conv_5b_double_3x3_reduce->ch_concat_5a_chconcat 1024x7x7 bn_5b_double_3x3_reduce BatchNorm bn_5b_double_3x3_reduce->conv_5b_double_3x3_reduce 192x7x7 relu_5b_double_3x3_reduce Activation relu relu_5b_double_3x3_reduce->bn_5b_double_3x3_reduce 192x7x7 conv_5b_double_3x3_0 Convolution 3x3/1, 224 conv_5b_double_3x3_0->relu_5b_double_3x3_reduce 192x7x7 bn_5b_double_3x3_0 BatchNorm bn_5b_double_3x3_0->conv_5b_double_3x3_0 224x7x7 relu_5b_double_3x3_0 Activation relu relu_5b_double_3x3_0->bn_5b_double_3x3_0 224x7x7 conv_5b_double_3x3_1 Convolution 3x3/1, 224 conv_5b_double_3x3_1->relu_5b_double_3x3_0 224x7x7 bn_5b_double_3x3_1 BatchNorm bn_5b_double_3x3_1->conv_5b_double_3x3_1 224x7x7 relu_5b_double_3x3_1 Activation relu relu_5b_double_3x3_1->bn_5b_double_3x3_1 224x7x7 max_pool_5b_pool Pooling max, 3x3/1 max_pool_5b_pool->ch_concat_5a_chconcat 1024x7x7 conv_5b_proj Convolution 1x1/1, 128 conv_5b_proj->max_pool_5b_pool 1024x7x7 bn_5b_proj BatchNorm bn_5b_proj->conv_5b_proj 128x7x7 relu_5b_proj Activation relu relu_5b_proj->bn_5b_proj 128x7x7 ch_concat_5b_chconcat Concat ch_concat_5b_chconcat->relu_5b_1x1 352x7x7 ch_concat_5b_chconcat->relu_5b_3x3 320x7x7 ch_concat_5b_chconcat->relu_5b_double_3x3_1 224x7x7 ch_concat_5b_chconcat->relu_5b_proj 128x7x7 global_pool Pooling avg, 7x7/1 global_pool->ch_concat_5b_chconcat 1024x7x7 flatten Flatten flatten->global_pool 1024x1x1 fc1 FullyConnected 1000 fc1->flatten 1024 softmax SoftmaxOutput softmax->fc1 1000

In [ ]: