def inference(inputs, keep_prob,
bottleneck_size=128,
phase_train=True,
weight_decay=0.0,
reuse=None):
batch_norm_params = {
'decay': 0.995,
'epsilon': 0.001,
'updates_collections': None,
# 'scale': True} # [test1: add 'gamma']
'variables_collections': [tf.GraphKeys.TRAINABLE_VARIABLES]} # [test2: removed from 'trainable_variables']
with slim.arg_scope(
[slim.conv2d, slim.fully_connected],
weights_initializer=tf.truncated_normal_initializer(stddev=0.1),
weights_regularizer=slim.l2_regularizer(weight_decay),
biases_regularizer=slim.l2_regularizer(weight_decay),
normalizer_fn=slim.batch_norm,
normalizer_params=batch_norm_params): # [test4: add weight_decay to biases]):
return inception_resnet_v2(
inputs,
is_training=phase_train,
keep_prob=keep_prob,
bottleneck_size=bottleneck_size,
reuse=reuse)
inception_resnet_v2_modified.py 文件源码
python
阅读 18
收藏 0
点赞 0
评论 0
评论列表
文章目录