Proper way to use batch normalization with keras

What is the right way to use batch normalization from Keras? I don't use Sequential

bnkeras
4 votesNN132.00
1 Answers
JW229.00
2

You just need to call BatchNormalization layer in your code, but make sure you've config you data_format in keras.

If you use Tensorflow and your data_format="channel_first", then you need to pass axis=1 (by default), if data_format="channel_last" then axis=-1. Here is the code

import keras
x = keras.layers.BatchNormalization(name='my_bn_layer')(_input)
Reply
Couldn't find what you were looking for?and we will find an expert to answer.
How helpful was this page?