# Week 3 exercise 8\_nn\_model

**URL:** <https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238>\
**Category:** Neural Networks and Deep Learning\
**Tags:** coursera-platform\
**Created:** [August 12, 2022, 3:32am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238 "2022-08-12T03:32:21Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ru\_WANG](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Ru\_WANG](https://community.deeplearning.ai/u/Ru_WANG)\
**Post date:** [August 12, 2022, 3:32am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/1 "2022-08-12T03:32:22Z")

</div>

I passed all the tests before this exercise 8, but I can not figure out the problem here :

 ![2022-08-12 05_14_31-Window](https://global.discourse-cdn.com/dlai/original/3X/f/e/fe19f65819c70b30dcddb244ba517701aa7484ef.png)

---

<div class="post-metadata">

**Author:** ![paulinpaloalto](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/paulinpaloalto/32/187_2.png) [@paulinpaloalto](https://community.deeplearning.ai/u/paulinpaloalto)\
**Post date:** [August 12, 2022, 4:21am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/2 "2022-08-12T04:21:06Z")

</div>

Notice that your cost values after 1000 and 2000 iterations are quite a bit higher than the expected values. That would suggest there is something wrong with your “update parameters” logic. But if you are sure that all your previous functions passed their tests, then the bug (whatever it is) must be in `nn_model` . E.g. you are passing the wrong arguments to one of the previous functions when you call it from `nn_model` .

---

<div class="post-metadata">

**Author:** ![anon57530071](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon57530071](https://community.deeplearning.ai/u/anon57530071)\
**Post date:** [August 12, 2022, 4:55am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/3 "2022-08-12T04:55:16Z")

</div>

Did you set “learning\_rate” to “0.005” at somewhere ? All your outputs are exactly same as the case if we set the learning rate to 0.005. Please double check.

---

<div class="post-metadata">

**Author:** ![Ru\_WANG](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Ru\_WANG](https://community.deeplearning.ai/u/Ru_WANG)\
**Post date:** [August 13, 2022, 9:38am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/4 "2022-08-13T09:38:05Z")

</div>

Yes, I had set “learning\_rate” to “0.005”.

---

<div class="post-metadata">

**Author:** ![anon57530071](https://avatars.discourse-cdn.com/v4/letter/a/46a35a/32.png) [@anon57530071](https://community.deeplearning.ai/u/anon57530071)\
**Post date:** [August 13, 2022, 9:52am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/5 "2022-08-13T09:52:38Z")

</div>

You do not need to set by yourself for this exercise. (In the real world, you need to set as a hyper-parameter, but, for this testing, do not.) The purpose of this test is to check your implementation.

So, just removing it makes you go forward. 🙂

---

<div class="post-metadata">

**Author:** ![Ru\_WANG](https://avatars.discourse-cdn.com/v4/letter/r/41988e/32.png) [@Ru\_WANG](https://community.deeplearning.ai/u/Ru_WANG)\
**Post date:** [August 14, 2022, 3:41am UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/6 "2022-08-14T03:41:56Z")

</div>

Hi, Thanks a lot, it is as you said, need to remove the learning\_rate setting. It works! And thanks again for pointing out the local/global variable errors !

---

<div class="post-metadata">

**Author:** ![Yagmur\_Gulec](https://avatars.discourse-cdn.com/v4/letter/y/bc8723/32.png) [@Yagmur\_Gulec](https://community.deeplearning.ai/u/Yagmur_Gulec)\
**Post date:** [August 11, 2023, 2:02pm UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/7 "2023-08-11T14:02:52Z")

</div>

I was wondering if you could resolve the problem.  
Thanks in advance

---

<div class="post-metadata">

**Author:** ![saifkhanengr](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/saifkhanengr/32/152858_2.png) [@saifkhanengr](https://community.deeplearning.ai/u/saifkhanengr)\
**Post date:** [August 11, 2023, 3:25pm UTC](https://community.deeplearning.ai/t/week-3-exercise-8-nn-model/183238/8 "2023-08-11T15:25:24Z")

</div>

The solution is in this thread. Please read the full thread.
