python 批量标准化,然后在tensorflow中激活ReLU。

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python 批量标准化,然后在tensorflow中激活ReLU。相关的知识,希望对你有一定的参考价值。

def batch_norm_relu(inputs, is_training, data_format):
    """
    Performs a batch normalization followed by a ReLU.
    :param inputs:
    :param is_training:
    :param data_format:
    :return:
    """
    inputs = tf.layers.batch_normalization(
        inputs=inputs, axis=1 if data_format == 'channels_first' else 3,
        momentum=_BATCH_NORM_DECAY, epsilon=_BATCH_NORM_EPSILON, center=True,
        scale=True, training=is_training, fused=True
    )
    return inputs

以上是关于python 批量标准化,然后在tensorflow中激活ReLU。的主要内容,如果未能解决你的问题,请参考以下文章