Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/tensorflow/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 在Tensorflow 2.0中重写tf.contrib.layers.batch_norm_Python_Tensorflow_Batch Normalization - Fatal编程技术网

Python 在Tensorflow 2.0中重写tf.contrib.layers.batch_norm

Python 在Tensorflow 2.0中重写tf.contrib.layers.batch_norm,python,tensorflow,batch-normalization,Python,Tensorflow,Batch Normalization,有人能帮我重写Tf2.0中的以下代码块吗? 我知道batch_norm相当于keras.layers.BatchNormalization,但文档中没有给出“decay”和“epsilon”对应的明确解决方案。谢谢 def batch_norm(opts, _input, is_train, reuse, scope, scale=True): """Batch normalization based on tf.contrib.layers. &

有人能帮我重写Tf2.0中的以下代码块吗?
我知道batch_norm相当于keras.layers.BatchNormalization,但文档中没有给出“decay”和“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)

在这种情况下,
衰变
对应于
tf.keras.layers的
动量
。批标准化
ε
仍然是
ε

在这种情况下,
衰变
对应于
tf.keras.layers的
动量
。批标准化
ε
仍然是
epsilon

很抱歉,很快,我该如何处理BatchNormalization中没有出现的rest参数?您能帮助在TF2中重写这段代码吗?谢谢!很抱歉,我是如何处理BatchNormalization中未出现的rest参数的?您是否可以帮助在TF2中重写这段代码?谢谢!