# Problem with Exercise 2 and Exercise 6 Week3

**URL:** <https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772>\
**Category:** Calculus for Machine Learning and Data Science\
**Tags:** week-module-3\
**Created:** [November 2, 2023, 1:57pm UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772 "2023-11-02T13:57:40Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Prateek\_Gaur](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prateek\_Gaur](https://community.deeplearning.ai/u/Prateek_Gaur)\
**Post date:** [November 2, 2023, 1:57pm UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/1 "2023-11-02T13:57:40Z")

</div>

![Error 2-b](https://global.discourse-cdn.com/dlai/original/3X/f/8/f8e0ea0a07ebb17f348604c39df02163f7a2340b.png)  
 ![Error 2-a](https://global.discourse-cdn.com/dlai/original/3X/0/5/05e9f3aa5b75cedb4b44b4e3dbf743f105ca84c7.png)  
 ![Error1](https://global.discourse-cdn.com/dlai/original/3X/c/9/c9ca037e895fb0ff4424016c4221e692e2fcf763.png)

Please help me with this problem (Exercise 2 and Exercise 6). Thanks in advance.

---

<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:** [November 2, 2023, 5:49pm UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/2 "2023-11-02T17:49:15Z")

</div>

You have at least three problems:  
= = = =

1. Do not hard-code the learning rate to a specific value.  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/b/1/b1e6901cdda423a627b163dbec65fd8f59c6781d.png)

Just use the learning\_rate parameter.

= = = =  
2) It looks like you edited the default learning rate value from the function definition:  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/d/c/dcfcdc8126c250e19bfd3071da0e4e08c56b842a.png)

Do not modify the function definition.

= = = =  
3) In layer\_sizes(), your code for these two lines is not correct.  
 ![image](https://global.discourse-cdn.com/dlai/original/3X/7/4/74f93ab5e8f462a9aff5b9bafed1e58f9e038055.png)

You need to use the shapes of X and Y to set n\_x and n\_y.

---

<div class="post-metadata">

**Author:** ![Prateek\_Gaur](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prateek\_Gaur](https://community.deeplearning.ai/u/Prateek_Gaur)\
**Post date:** [November 3, 2023, 6:55am UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/3 "2023-11-03T06:55:14Z")

</div>

Hello,  
Thanks for your reply but it still has problems. Even after applying the shape function for X and Y, it is showing the same error and now exercise 3, and exercise 4 is affected by the result of exercise 2.  
Regarding, exercise 6, I don’t understand what change I made wrong. I removed the learning rate value but it is still showing problems. I didn’t understand your line 32 “?” hint.  
I even tried to make the notebook just like the original by deleting all the inputs I provided but it is also not possible.  
Sorry for the inconvenience!  
/notebooks/C2\_W3\_Assignment.ipynb

---

<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:** [November 5, 2023, 9:24pm UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/4 "2023-11-05T21:24:25Z")

</div>

> [@Prateek\_Gaur](#):
>
> I didn’t understand your line 32 “?” hint.

Do not set a hard-coded learning rate in lines 32, 33, or 34. Just use the learning\_rate variable.

---

<div class="post-metadata">

**Author:** ![Prateek\_Gaur](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prateek\_Gaur](https://community.deeplearning.ai/u/Prateek_Gaur)\
**Post date:** [November 13, 2023, 2:35pm UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/5 "2023-11-13T14:35:54Z")

</div>

Hello Sir, I tried everything but it is not happening. I don’t know what is the problem. Will you please look towards my assignment and help me with this?

> **[Coursera | Online Courses & Credentials From Top Educators. Join for Free...](https://www.coursera.org/learn/machine-learning-calculus/programming/TyyUv/neural-network-with-two-layers/lab?path=%2Fnotebooks%2FC2_W3_Assignment.ipynb)**
>
> Learn online and earn valuable credentials from top universities like Yale, Michigan, Stanford, and leading companies like Google and IBM. Join Coursera for free and transform your career with degrees, certificates, Specializations, & MOOCs in...

/notebooks/C2\_W3\_Assignment.ipynb

---

<div class="post-metadata">

**Author:** ![Prateek\_Gaur](https://avatars.discourse-cdn.com/v4/letter/p/b3f665/32.png) [@Prateek\_Gaur](https://community.deeplearning.ai/u/Prateek_Gaur)\
**Post date:** [November 18, 2023, 1:03am UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/6 "2023-11-18T01:03:34Z")

</div>

Is there anyone who completed this assignment and willing to help me with this??? Thank you in advance.

---

<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:** [November 18, 2023, 1:22am UTC](https://community.deeplearning.ai/t/problem-with-exercise-2-and-exercise-6-week3/483772/7 "2023-11-18T01:22:09Z")

</div>

Check your private messages in a few minutes.
