假设
i
n
p
u
t
input
input大小为:
i
n
c
×
i
n
h
×
i
n
w
in_c \times in_h \times in_w
inc×inh×inw,
o
u
t
p
u
t
output
output大小为:
o
u
t
c
×
o
u
t
h
×
o
u
t
w
out_c \times out_h \times out_w
outc×outh×outw,
Ghost module将普通卷积拆解为三步执行,第一步先用
k
×
k
k\times k
k×k卷积核输出通道数为
i
n
i
t
_
c
h
a
n
n
e
l
s
init\_channels
init_channels的feature maps, (
i
n
i
t
_
c
h
a
n
n
e
l
s
=
c
e
i
l
(
o
u
t
_
c
h
a
n
n
e
l
s
s
)
init\_channels = ceil(\frac{out\_channels }{ s})
init_channels=ceil(sout_channels)), s代表将
o
u
t
_
c
h
a
n
n
e
l
s
out\_channels
out_channels分为s组。第二,在第一步的feature_maps上进行depthwise convolution(线性变换)输出
(
s
−
1
)
×
i
n
i
t
_
c
h
a
n
n
e
l
s
(s-1)\times init\_channels
(s−1)×init_channels通道的feature maps, 最后,将
i
n
i
t
_
c
h
a
n
n
e
l
s
init\_channels
init_channels的feature maps和第二步输出的前
(
o
u
t
_
c
h
a
n
n
e
l
s
−
i
n
i
t
_
c
a
h
n
n
e
l
s
)
(out\_channels-init\_cahnnels)
(out_channels−init_cahnnels)个feature map concat一起。