def fc_layers(net,
scope,
end_points_collection,
num_classes=10,
is_training=True,
dropout_keep_prob=0.5,
name_prefix=None):
def full_scope_name(scope_name):
return scope_name if name_prefix is None else '%s_%s' % (name_prefix, scope_name)
with slim.arg_scope([slim.fully_connected, slim.dropout],
outputs_collections=[end_points_collection]):
'''
with droupout accuracy: 0.68, data: 4.2M
without droupout accuracy: 0.71, data: 4.2M
'''
# net = slim.dropout(net, dropout_keep_prob, is_training=is_training,
# scope=full_scope_name('dropout3'))
net = slim.fully_connected(net, num_classes, activation_fn=None,
scope=full_scope_name('fc4'))
return net, end_points_collection
评论列表
文章目录