【发布时间】:2020-07-08 18:58:13
【问题描述】:
有人可以帮我在 Tf2.0 中重写以下代码块吗?
我知道 batch_norm 相当于 keras.layers.BatchNormalization 但文档没有给出关于“衰减”和“epsilon”对应的明确解决方案。谢谢!
def batch_norm(opts, _input, is_train, reuse, scope, scale=True):
"""Batch normalization based on tf.contrib.layers.
"""
return tf.contrib.layers.batch_norm(
_input, center=True, scale=scale,
epsilon=opts['batch_norm_eps'], decay=opts['batch_norm_decay'],
is_training=is_train, reuse=True, updates_collections=None,
scope=scope, fused=False)
【问题讨论】:
标签: python tensorflow batch-normalization