tf.layers.BatchNormalization有两个参数training和trainable。
training controls whether to use the training-mode batchnorm (which uses statistics from this minibatch) or inference-mode batchnorm (which uses averaged statistics across the training data).
trainable controls whether the variables created inside the batchnorm process are themselves trainable.
在测试的时候,如果设置training=True,由于batch size=1,导致mean=x,(x-mean)=0。所以BN层的输出只剩beta,每次的输出都一模一样。
BN 注意事项:
- tf.layers.batch_normalization()中参数training=True
- UPDATE_OPS:

详见:tf.layers.batch_normalization;TENSORFLOW GUIDE: BATCH NORMALIZATION