【发布时间】:2018-06-29 15:21:24
【问题描述】:
我有一个旨在构建架构的函数
Input(x) -> o=My_ops(x,128) -> o=slim.batch_norm(o)
所以,我的功能是
def _build_block(self, x, name, is_training=True):
with tf.variable_scope(name) as scope:
o = my_ops(x, 256)
batch_norm_params = {
'decay': 0.9997,
'epsilon': 1e-5,
'scale': True,
'updates_collections': tf.GraphKeys.UPDATE_OPS,
'fused': None, # Use fused batch norm if possible.
'is_training': is_training
}
with slim.arg_scope([slim.batch_norm], **batch_norm_params) as bn:
return slim.batch_norm(o)
我说的对吗?我可以在上面的函数中设置is_training 吗?如果没有,你能帮我解决吗?
【问题讨论】:
-
你真的需要
arg_scope来获得一个batch_norm吗? -
因为我必须使用像is_training=True这样的客户设置,衰减0.9997,所以我用它来传递bn参数。你有其他方法吗?谢谢
标签: tensorflow deep-learning tf-slim batch-normalization tensorflow-slim