请教复现MobileFaceNets问题
Created by: yeyupiaoling
我在复现 MobileFaceNets 模型的时候,为什么这个模型没有说全连接层,它是否需要用到全连接层?
def net(input, class_dim):
bottleneck_params_list = [
(2, 64, 5, 2),
(4, 128, 1, 2),
(2, 128, 6, 1),
(4, 128, 1, 2),
(2, 128, 2, 1),
]
# conv 3*3
input = conv_bn_layer(input,
num_filters=64,
filter_size=3,
stride=2,
padding=1,
if_act=True)
# detphwise conv 3*3
input = depthwise_separable(input,
num_filters1=64,
num_filters2=64,
num_groups=64,
stride=1,
padding=1,
if_act=True)
# bottleneck
in_c = 32
for layer_setting in bottleneck_params_list:
t, c, n, s = layer_setting
input = invresi_blocks(input=input,
in_c=in_c,
t=t,
c=c,
n=n,
s=s)
in_c = c
# conv 1*1
input = conv_bn_layer(input=input,
num_filters=512,
filter_size=1,
stride=1,
padding=0,
if_act=True)
# linear GDConv 7*7
input = depthwise_separable(input,
num_filters1=512,
num_filters2=512,
num_groups=512,
stride=1,
padding=0,
if_act=False)
# linear conv 1*1
feature = conv_bn_layer(input=input,
num_filters=128,
filter_size=1,
stride=1,
padding=0,
if_act=False)
return feature