# Regarding batch normalization

**URL:** <https://community.deeplearning.ai/t/regarding-batch-normalization/3889>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [May 7, 2021, 6:05pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889 "2021-05-07T18:05:45Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nithin](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Nithin](https://community.deeplearning.ai/u/Nithin)\
**Post date:** [May 7, 2021, 6:05pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/1 "2021-05-07T18:05:45Z")

</div>

In week 1 assignment 2 in sequential layer we used BatchNormalization with argument axis=3, what exactly this axis=3 mean and why are we using batch normalization ?  
Also after executing happy\_model.summary() I found 64 non trainable parameters what are these 64 non trainable parameters?  
Thanks!

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [May 8, 2021, 2:46am UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/2 "2021-05-08T02:46:19Z")

</div>

Hi Nithin,

With regard to your first question have a look here: [[Week 2] what is the meaning of (axis = 3) in the BatchNormalization? - #6 by reinoudbosch](https://community.deeplearning.ai/t/week-2-what-is-the-meaning-of-axis-3-in-the-batchnormalization/589/6)

The 64 non trainable parameters are the mean and variance vectors of the batchnorm layer. With 32 features (axis=3 of the conv2d layer output) you get 32\*2 non trainable parameters. You can also have a look here: [Keras - number of parameters in BatchNorm Layer](https://community.deeplearning.ai/t/keras-number-of-parameters-in-batchnorm-layer/2202)

---

<div class="post-metadata">

**Author:** ![Nithin](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Nithin](https://community.deeplearning.ai/u/Nithin)\
**Post date:** [May 8, 2021, 12:15pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/3 "2021-05-08T12:15:18Z")

</div>

Thank for answering,  
My second doubt got clarified but…  
Can u tell me the difference between axis=2 and axis=3  
Thanks!

---

<div class="post-metadata">

**Author:** ![reinoudbosch](https://avatars.discourse-cdn.com/v4/letter/r/22d042/32.png) [@reinoudbosch](https://community.deeplearning.ai/u/reinoudbosch)\
**Post date:** [May 8, 2021, 3:59pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/4 "2021-05-08T15:59:50Z")

</div>

Hi Nithin,

Axis=0 refers to the training examples. Axis=1 and 2 describe 2D arrays with activation values that support the extraction of particular features. Axis=3 is the axis along which the 2D arrays (one array per filter) are stacked. In order to normalize values per feature, you want therefore to normalize along axis 3.

---

<div class="post-metadata">

**Author:** ![Nithin](https://avatars.discourse-cdn.com/v4/letter/n/919ad9/32.png) [@Nithin](https://community.deeplearning.ai/u/Nithin)\
**Post date:** [May 8, 2021, 4:53pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/5 "2021-05-08T16:53:53Z")

</div>

My doubt is clarified  
thank you!

---

<div class="post-metadata">

**Author:** ![James\_Nathan\_O](https://avatars.discourse-cdn.com/v4/letter/j/7ba0ec/32.png) [@James\_Nathan\_O](https://community.deeplearning.ai/u/James_Nathan_O)\
**Post date:** [August 16, 2021, 1:18pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/6 "2021-08-16T13:18:24Z")

</div>

wait why is it that in the sequential api we use batch normalization but we don’t in the functional api ?

---

<div class="post-metadata">

**Author:** ![TMosh](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/tmosh/32/9321_2.png) [@TMosh](https://community.deeplearning.ai/u/TMosh)\
**Post date:** [August 16, 2021, 5:15pm UTC](https://community.deeplearning.ai/t/regarding-batch-normalization/3889/7 "2021-08-16T17:15:23Z")

</div>

It likely has to do with the problem that is being solved, rather than the method being used. Perhaps batch normalization wasn’t required in the exercise that used the functional API.
