# Week 1 - Programming assignment - BatchNorm

**URL:** <https://community.deeplearning.ai/t/week-1-programming-assignment-batchnorm/326875>\
**Category:** Convolutional Neural Networks\
**Tags:** coursera-platform\
**Created:** [May 6, 2023, 5:35am UTC](https://community.deeplearning.ai/t/week-1-programming-assignment-batchnorm/326875 "2023-05-06T05:35:18Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mihail-Iulian\_Plesa](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mihail-Iulian\_Plesa](https://community.deeplearning.ai/u/Mihail-Iulian_Plesa)\
**Post date:** [May 6, 2023, 5:35am UTC](https://community.deeplearning.ai/t/week-1-programming-assignment-batchnorm/326875/1 "2023-05-06T05:35:18Z")

</div>

Hi,

During the 2nd programming assignment of week 1, we get the following network:

 ![image](https://global.discourse-cdn.com/dlai/original/3X/4/7/47abfea9fbe3d7667c71b425b458eb3754da7c97.png)

I don’t understand why we have 128 parameters for the batch norm layer. I know that a batch norm layer has only two trainable parameres.

Thank you!

---

<div class="post-metadata">

**Author:** ![rmwkwok](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/rmwkwok/32/126977_2.png) [@rmwkwok](https://community.deeplearning.ai/u/rmwkwok)\
**Post date:** [May 6, 2023, 7:27am UTC](https://community.deeplearning.ai/t/week-1-programming-assignment-batchnorm/326875/2 "2023-05-06T07:27:29Z")

</div>

Hi @Mihail-Iulian_Plesa,

Check out tensorflow’s doc page which said “for each channel”.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/3/b/3b644aa3c50c2829aaf4dea2663bd60d70253f26.png)

This should be a good hint for you to work out the number of parameters in a batch norm layer. Don’t forget that you can put aside the assignment, experiment the layer with different settings and input data shape.

Raymond

---

<div class="post-metadata">

**Author:** ![Mihail-Iulian\_Plesa](https://avatars.discourse-cdn.com/v4/letter/m/e274bd/32.png) [@Mihail-Iulian\_Plesa](https://community.deeplearning.ai/u/Mihail-Iulian_Plesa)\
**Post date:** [May 6, 2023, 11:21am UTC](https://community.deeplearning.ai/t/week-1-programming-assignment-batchnorm/326875/3 "2023-05-06T11:21:53Z")

</div>

Oh, I see. Thank you!!
