Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Batch normalization instead of input normalization

Can I use batch normalization layer right after input layer and not normalize my data? May I expect to get similar effect/performance?

In keras functional it would be something like this:

x = Input (...)
x = Batchnorm(...)(x)
...
like image 477
user2146414 Avatar asked Oct 16 '17 13:10

user2146414


People also ask

When should I not use batch normalization?

Not good for Recurrent Neural Networks Although batch normalization speeds-up training and generalization significantly in convolution neural networks, they are proven to be difficult to apply on recurrent architectures.

Do I need to normalize data if I use batch normalization?

To answer your question: Yes, you should still standardize your inputs to a network that uses Batch Normalization.

Why is batch normalization better?

Batch normalization solves a major problem called internal covariate shift. It helps by making the data flowing between intermediate layers of the neural network look, this means you can use a higher learning rate. It has a regularizing effect which means you can often remove dropout.

Is layer normalization better than batch normalization?

Batch Normalization vs Layer Normalization Batch normalization normalizes each feature independently across the mini-batch. Layer normalization normalizes each of the inputs in the batch independently across all features. As batch normalization is dependent on batch size, it's not effective for small batch sizes.


1 Answers

You can do it. But the nice thing about batchnorm, in addition to activation distribution stabilization, is that the mean and std deviation are likely migrate as the network learns.

Effectively, setting the batchnorm right after the input layer is a fancy data pre-processing step. It helps, sometimes a lot (e.g. in linear regression). But it's easier and more efficient to compute the mean and variance of the whole training sample once, than learn it per-batch. Note that batchnorm isn't free in terms of performance and you shouldn't abuse it.


like image 169
Maxim Avatar answered Oct 24 '22 01:10

Maxim