In tensorflow 1.4, I found two functions that do batch normalization and they look same:
tf.layers.batch_normalization (link)tf.co
As show in doc, tf.contrib is a contribution module containing volatile or experimental code. When function is complete, it will be removed from this module. Now there are two, in order to be compatible with the historical version.
So, the former tf.layers.batch_normalization is recommended.
Just to add to the list, there're several more ways to do batch-norm in tensorflow:
mean and variance tensors themselves.tf.nn.batch_normalization accepts tensors of any rank greater than 1.tf.layers). The use of it is not recommended because it may be dropped in the future releases.tf.nn.batch_normalization, but likely to be dropped in the future.tf.nn.batch_normalization.