# Is this the correct way of weight when there is a two layer neural network

**URL:** <https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442>\
**Category:** Calculus for Machine Learning and Data Science\
**Tags:** week-module-1\
**Created:** [October 19, 2023, 8:17pm UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442 "2023-10-19T20:17:35Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mohammad\_Omar\_Adde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mohammad_omar_adde/32/67669_2.png) [@Mohammad\_Omar\_Adde](https://community.deeplearning.ai/u/Mohammad_Omar_Adde)\
**Post date:** [October 19, 2023, 8:17pm UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/1 "2023-10-19T20:17:35Z")

</div>

![Screenshot 2023-10-19 at 11.13.13 PM](https://global.discourse-cdn.com/dlai/original/3X/3/8/38c0bbdb4ff29b248318bae8a6ded6f398ce5f11.png)

if you check the superscript of W which denotes the layer number, according to the notebook the input and the hidden layer have similar superscripts

@TMosh please have a look

Thanks.

---

<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:** [October 19, 2023, 9:38pm UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/2 "2023-10-19T21:38:39Z")

</div>

What exactly would you like me to comment on?

---

<div class="post-metadata">

**Author:** ![Mohammad\_Omar\_Adde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mohammad_omar_adde/32/67669_2.png) [@Mohammad\_Omar\_Adde](https://community.deeplearning.ai/u/Mohammad_Omar_Adde)\
**Post date:** [October 22, 2023, 6:55am UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/3 "2023-10-22T06:55:33Z")

</div>

what i need you to check is that, if you look the square brackets in W and Z it states the layer of the neural network right? but if you check the formula the superscript is all similar which is one while the lower one is changing so, is that the correct way?.

thanks

---

<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:** [October 22, 2023, 7:07am UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/4 "2023-10-22T07:07:53Z")

</div>

Hello @Mohammad_Omar_Adde,

The text focuses on the first and the second perceptron, which are all in the first layer, so the equations are for the first layer.

 ![image](https://global.discourse-cdn.com/dlai/original/3X/0/5/0502907b3478e86612721feb7db11295503ddf67.png)

Perhaps if the text switches to talk about the third perceptron, then there will be another equation that uses 2 in the superscripts of the symbols.

Cheers,  
Raymond

---

<div class="post-metadata">

**Author:** ![Mohammad\_Omar\_Adde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mohammad_omar_adde/32/67669_2.png) [@Mohammad\_Omar\_Adde](https://community.deeplearning.ai/u/Mohammad_Omar_Adde)\
**Post date:** [October 22, 2023, 7:13am UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/5 "2023-10-22T07:13:33Z")

</div>

oky that’s cool, so the hidden layer still counts as one, am i right?

---

<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:** [October 22, 2023, 7:22am UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/6 "2023-10-22T07:22:28Z")

</div>

This network has only one hidden layer, and one output layer. The index of these layer starts from 1. I guess this is what you are asking?

---

<div class="post-metadata">

**Author:** ![Mohammad\_Omar\_Adde](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mohammad_omar_adde/32/67669_2.png) [@Mohammad\_Omar\_Adde](https://community.deeplearning.ai/u/Mohammad_Omar_Adde)\
**Post date:** [October 22, 2023, 7:22am UTC](https://community.deeplearning.ai/t/is-this-the-correct-way-of-weight-when-there-is-a-two-layer-neural-network/473442/7 "2023-10-22T07:22:54Z")

</div>

yeah thanks
