在tensorflow中,Batch Normalization有不同实现
tf.layers.BatchNormalization
tf.layers.batch_normalization
tf.keras.layers.BatchNormalization
tf.nn.batch_normalization
上述4个API按层次可分为两类:
高级API:tf.layers.BatchNormalization,tf.layers.batch_normalization,tf.keras.layers.BatchNormalization
低级API:tf.nn.batch_normalization
上述4个API按行为可分为两类:
TensorFlow API:tf.layers.BatchNormalization、tf.layers.batch_normalization、tf.nn.batch_normalization
Keras API:tf.keras.layers.BatchNormalization
keras.layers.BatchNormalization会指向site_packages/keras/layers/normalization.py
tf.keras.layers.BatchNormalization会指向site_packages/tensorflow/python/keras/layers/normalization.py
通过查看源代码,发现实现完全不同