Questions tagged [batch-normalization]

For questions about Batch Normalization of layer activations in theory and practice, as used in (typically deep) neural networks.

Filter by
Sorted by
Tagged with
0
votes
1answer
38 views

Equations in "Batch normalization: theory and how to use it with Tensorflow"

I read the article Batch normalization: theory and how to use it with Tensorflow by Federico Peccia. The batch normalized activation is $$ \bar x_i = \frac{x_i - \mu_B}{\sqrt{\sigma_B^2 + \epsilon}} $$...
1
vote
1answer
18 views

Explanation of Karpathy tweet about common mistakes. #5: "you didn't use bias=False for your Linear/Conv2d layer when using BatchNorm"

I recently found this twitter thread from Andrej Karpathy. In it he states a few common mistakes during the development of a neural network. you didn't try to overfit a single batch first. you forgot ...
0
votes
0answers
32 views

Batch normalization backpropagation doubts

I have recently studied the batch normalization layer and its backpropagation process, using as my main sources the original paper and this website showing part of the derivation process, but there is ...
0
votes
0answers
8 views

Sequential batch processing vs parallel batch processing?

In deep learning based model training, in general batch of inputs are passed. For example for training a deep learning model with [512] dimensional input feature vector, say for batch size= 4, we ...
0
votes
0answers
238 views

To freeze or not, batch normalisation in ResNet when transfer learning

I'm using a ResNet50 model pretrained on ImageNet, to do transfer learning, fitting an image classification task. The easy way of doing this is simply freezing the conv layers (or really all layers ...
0
votes
1answer
24 views

Batch normalization for multiple datasets?

I am working on a task of generating synthetic data to help the training of my model. This means that the training is performed on synthetic + real data, and tested on real data. I was told that batch ...
0
votes
0answers
18 views

What is num_groups in GroupNorm and how to choose it

I found that batch_norm can cause problems with small batch sizes and that GroupNorm is a good alternative. Now, GroupNorm requires two parameters, the num_group and the num_channels. How can I choose ...
1
vote
1answer
35 views

Using batchnorm and dropout simultaneously?

I am a bit confused about the relation between terms "Dropout" and "BatchNorm". As I understand, Dropout is regularization technique, which is using only during training. ...
2
votes
1answer
972 views

How batch normalization layer resolve the vanishing gradient problem?

According to this article: https://towardsdatascience.com/the-vanishing-gradient-problem-69bf08b15484 The vanishing gradient problem occurs when using the sigmoid ...
0
votes
0answers
16 views

Keras model seems unable to generalize with BatchNormalization

Same data set, two slightly similar models. The run for both looks like this: ...
1
vote
1answer
43 views

Poor CNN performance after implementing BatchNormalization

I am training a CNN to classify malware images from a dataset named Malimg. Before implementing the BatchNormalization layer, I was getting an accuracy of 95.57% (see below for the graph of loss/...
0
votes
0answers
29 views

Regularization with Batch Normalization on DNN

When using Batch Normalization I've seen that L2 Regularization shouldn't be used because the only impact will be on the learning rate (source: https://blog.janestreet.com/l2-regularization-and-batch-...
1
vote
0answers
52 views

Can Batch Normalization replace tanh in RNN?

Question Can Batch Normalization (BN) be inserted in RNN after $x_t@W_{xh}$, and after $h_{t-1}@W_{hh}$ to remove $f=tanh$ and bias $b_h$? If possible, will this ...
1
vote
0answers
36 views

BUG: Tensorflow accuracy on training data different when training than when evaluating

I think I have made some sort of error because my model has a substantially different accuracy while training: ...
1
vote
0answers
43 views

How to properly train batch-normalization networks with gradient accumulation?

Using gradient accumulation efficiently replicate training with larger batch sizes for networks that are independent on the batch size. However, networks with BN layers rely on a batch size -- running ...
3
votes
1answer
152 views

How does batch normalization work for convolutional neural networks

I am trying to understand how batch normalization (BN) works in CNNs. Suppose I have a feature map tensor $T$ of shape $(N, C, H, W)$ where $N$ is the mini-batch size, $C$ is the number of channels, ...
2
votes
1answer
253 views

Batch normalization for image CNN - Why not use the mean of the entire batch?

Question For CNN to recognize images, why not use the entire batch data, instead of per feature, to calculate the mean in the Batch Normalization? When each feature is independent, need to use per ...
5
votes
1answer
1k views

Transfer Learning for CNNs and Batch Norm Layers

In some transfer learning models, we set the training argument to False to maintain the pre-trained values of Batch Normalization for example, but the ...
1
vote
1answer
229 views
1
vote
0answers
39 views

Normalizing historical data in time-series LSTMs

I am currently trying to solve a sequence prediction problem using LSTMs in a keras architecture. To illustrate the problem I give the following example which resemble the problem I must solve. Lets ...
1
vote
0answers
189 views

How to standardise/normalise csv data in a tensorflow 2 dataset

Does anyone know how to apply standardisation (or normalisation) on the numerical features of a dataset loaded in batch via tf.data.experimental.make_csv_dataset in ...
3
votes
1answer
1k views

Keras BatchNormalization axis

I use spectrogram as input to a Convolutional Neural Network I have created with tensorflow.keras in Python. Its shape is (time, frequency, 1). The input's shape of the CNN is (None, time, ...
1
vote
1answer
525 views

Which batch size to use when Batch Normalization?

I want to train a CNN in Keras (optimizer Adam) and by using batch normalization after every ConvLayer and before every activation layer. So far I mostly see examples in which training is carried out ...
2
votes
3answers
329 views

Normalization in production

I am currently writing a machine learning pipeline for my time series application. At the end of each month, I get the data gathered, normalize it ([0, 1]), retrain the ML model with the new ...
1
vote
1answer
893 views

Why would batch normalization allows us to use higher learning rate in the neural network?

I am doing some study about the BatchNormalization: https://towardsdatascience.com/batch-normalization-8a2e585775c9 In the article, it says: ...
0
votes
1answer
4k views

The added layer must be an instance of class Layer. Found: <keras.layers.normalization.BatchNormalization object at 0x0000024B0C16B780>

I don't know why BatchNormalization is giving the following error. Googled out but couldn't find any relevant answers My code appears to be this:
1
vote
0answers
94 views

BatchNorm vs InstNorm from the perspective of feature distributions

What I understand so far... The main purpose of BatchNorm is to overcome covariance shift -- more specifically what the authors of BatchNorm coined "internal covariance shift". Covariance shift is ...
1
vote
1answer
541 views

Batch Normalization with CUDNN

I want to introduce Batch Normalization in my C++/CUDNN implementation of CNN. The implementation is currently performing well (without BN) on the MNIST dataset. I am using the CUDNN implementation ...
1
vote
0answers
74 views

L1-Norm Batch Normalization for Efficient Training of Deep Neural Networks

Could anyone help to derive equation (15) dL/dx in L1-Norm Batch Normalization for Efficient Training of Deep Neural Networks ? I found that the term inside the rectangle for the expression (12) is ...
1
vote
1answer
627 views

Batch Normalization and Dropout together causing incorrect segmentation results

So, I've been running a test to see how well a number of networks can perform road segmentation on a particular customer's dataset. I am testing UNET, RDRCNN, and Tiramisu against each other. UNET ...
2
votes
1answer
102 views

Where can Batch Normalization be used? CNNs or everywhere?

Should BatchNormalization be used only in CNNs or can they be used in Fully Connected Networks, Recurrent networks as well?
1
vote
1answer
382 views

How does Batch Normalization in Machine Learning address covariate shift and speed up training?

In this video and this answer, it's mentioned that batch normalization doesn't allow the mean and variance of the parameters of any particular hidden layer to vary too much with change in previous ...
0
votes
0answers
108 views

Why does BatchNorm on FC layers increase my error?

I am training a deep CNN for multivariate regression, with three fully connected layers on top of the convolutions. I am using Sigmoid activation for FC layers. When adding BatchNormalization (BN) I ...
1
vote
2answers
1k views

Keras models break when I add batch normalization

I'm creating the model for a DDPG agent (keras-rl version) but i'm having some trouble with errors whenever I try adding in batch normalization in the first of two networks. Here is the creation ...
0
votes
2answers
4k views

When to use model.train() vs model.eval() in Pytoch?

I have a model that is used in a reinforcement learning algorithm for checkers, a la AlphaZero. Similar to that network, mine features batch normalization after each convolution layer. I am aware that ...
0
votes
1answer
1k views

What exactly is BatchNormalization() in Keras?

A month or two straight away into building image classifiers, I just sandwiched the BatchNormalization layer between conv2d. I wonder what it does, but I have seen my model learn faster in presence of ...
0
votes
1answer
205 views

Compute gradients in parallel

Here is part of my code: ...
0
votes
0answers
133 views

Neural Network fails to train when a particular batch normalization layer is removed?

Background info: I built a baseline CNN model for the cifar10 dataset using batch normalization and then ReLu activation after each convolution layer. There are a couple of max pooling layers in ...
1
vote
1answer
2k views

If we are using batch normalization as the first layer, can we forego standard scaling of inputs?

It is common practice to use the standard scaler on the inputs before feeding it to a deep learning architecture. I was wondering whether it is necessary if the first layer is a batch normalization ...
3
votes
1answer
2k views

Keras multi-gpu batch normalization

1) How does the batch normalization layer work with multi_gpu_model? Is it calculated separately on each GPU, or is somehow synchronized between GPUs? 2) Which batch normalization parameters are ...
1
vote
0answers
246 views

Do batch norm makes sense for regression problems?

When my network is performing regression (like DQN) it makes sense to use batchnorm in network when output of my network should vary from [0, 100000]? one way to tackle it is to normalize output but ...
1
vote
0answers
33 views

How much batch effect is too much batch effect?

Algorithms such as ComBat/SVA are powerful tools for the removal of batch effects. Small batch effects can be confidently removed by these methods. But surely there must exist batch effects which are ...
0
votes
2answers
1k views

Conv bias or not with Instance Normalization?

It is well known that Conv layers that are followed by BatchNorm ones should not have bias due to BatchNorm having a bias term. Using InstanceNorm however, the statistics are instance-specific rather ...
0
votes
1answer
1k views

Why BatchNormalization fails in Keras

I try to test ResNet approach on cifar10 dataset with the following python code: ...
9
votes
2answers
10k views

Batch normalization vs batch size

I have noticed that my performance of VGG 16 network gets better if I increase the batch size from $64$ to $256$. I have also observed that, using batch size $64$, ...
11
votes
2answers
2k views

Does batch normalization mean that sigmoids work better than ReLUs?

Batch normalization and ReLUs are both solutions to the vanishing gradient problem. If we're using batch normalization, should we then use sigmoids? Or are there features of ReLUs that make them ...
3
votes
1answer
179 views

In batch normalization, shouldn't using DropConnect harm test accuracy?

In my understanding of batch normalization, mean and variance are calculated over the entire batch and then added to the population average. This average is then applied to the test set to estimate ...
5
votes
2answers
6k views

Relationship between batch size and the number of neurons in the input layer

Regarding LSTM neural networks, I am unable to understand the relationship between batch size, the number of neurons in the input layer and the number of "variables" or "columns" in the input. (...
2
votes
1answer
1k views

Batch Normalization and Input Normalization in CNN

I build my CNN on Keras, normally in the ImageDataGenerator I saw the rescale = 1. / 255 used to normalize input data (pixel ...
6
votes
2answers
3k views

deriving the gradient of batch normalization

I'm trying to figure out the gradient of batch norm wrt x for backprop, but I get stuck in what I will call 'the triangle of (gradient) death'. I present to you the triangle of death (in red), in the ...