# Week 2 assignment error

**URL:** <https://community.deeplearning.ai/t/week-2-assignment-error/176557>\
**Category:** Supervised ML: Regression and Classification\
**Tags:** week-module-2\
**Created:** [August 2, 2022, 8:21pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557 "2022-08-02T20:21:45Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![vivek16pawar](https://avatars.discourse-cdn.com/v4/letter/v/c0e974/32.png) [@vivek16pawar](https://community.deeplearning.ai/u/vivek16pawar)\
**Post date:** [August 2, 2022, 8:21pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/1 "2022-08-02T20:21:45Z")

</div>

## Gradient at initial w, b (zeros): -1.108132775257732 -0.18136082474226803 Using X with shape (4, 1)

AssertionError Traceback (most recent call last)  
 in   
6 print(‘Gradient at initial w, b (zeros):’, tmp\_dj\_dw, tmp\_dj\_db)  
7  
----\> 8 compute\_gradient\_test(compute\_gradient)

~/work/public\_tests.py in compute\_gradient\_test(target)  
60 dj\_dw, dj\_db = target(x, y, initial\_w, initial\_b)  
61 #assert dj\_dw.shape == initial\_w.shape, f"Wrong shape for dj\_dw. {dj\_dw} != {initial\_w.shape}"  
—\> 62 assert dj\_db == -2, f"Case 1: dj\_db is wrong: {dj\_db} != -2"  
63 assert np.allclose(dj\_dw, -10.0), f"Case 1: dj\_dw is wrong: {dj\_dw} != -10.0"  
64

AssertionError: Case 1: dj\_db is wrong: -0.5 != -2

---

<div class="post-metadata">

**Author:** ![mrafat](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mrafat/32/21026_2.png) [@mrafat](https://community.deeplearning.ai/u/mrafat)\
**Post date:** [August 4, 2022, 12:16am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/5 "2022-08-04T00:16:11Z")

</div>

Hello @vivek16pawar,

Do you mind dming me a copy of your notebook and I can take a look ?

Regards,

Mohamed

---

<div class="post-metadata">

**Author:** ![Jesus\_Suniaga](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Jesus\_Suniaga](https://community.deeplearning.ai/u/Jesus_Suniaga)\
**Post date:** [August 4, 2022, 11:06am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/6 "2022-08-04T11:06:48Z")

</div>

i also completed well the week2 assigment. My results coincide with the expected ones, however I obtained zero in this assignment. I would know wat I did wrong,  
Please give me some answer about it

---

<div class="post-metadata">

**Author:** ![Muhammed\_sahal](https://avatars.discourse-cdn.com/v4/letter/m/94ad74/32.png) [@Muhammed\_sahal](https://community.deeplearning.ai/u/Muhammed_sahal)\
**Post date:** [August 4, 2022, 12:44pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/7 "2022-08-04T12:44:48Z")

</div>

Hi I’m having similar trouble too,can I send you my notebook too?

---

<div class="post-metadata">

**Author:** ![mrafat](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mrafat/32/21026_2.png) [@mrafat](https://community.deeplearning.ai/u/mrafat)\
**Post date:** [August 6, 2022, 2:00am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/8 "2022-08-06T02:00:18Z")

</div>

Hello @Jesus_Suniaga,

Do you mind dming me your notebook and I can take a look ?

Regards,

Mohamed

---

<div class="post-metadata">

**Author:** ![mrafat](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mrafat/32/21026_2.png) [@mrafat](https://community.deeplearning.ai/u/mrafat)\
**Post date:** [August 6, 2022, 2:02am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/9 "2022-08-06T02:02:48Z")

</div>

Hello @Muhammed_sahal,

Yeah I’ve received your DM and I’ve provided some feedback regarding your assignment.

Let me know if you have any questions,

Mohamed

---

<div class="post-metadata">

**Author:** ![mrafat](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mrafat/32/21026_2.png) [@mrafat](https://community.deeplearning.ai/u/mrafat)\
**Post date:** [August 6, 2022, 6:18pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/11 "2022-08-06T18:18:38Z")

</div>

Hello @Jesus_Suniaga,

Not sure if you are aware, but you should not share your code publicly. Could you please remove this link and dm me a copy of your notebook and I can take a look.

Regards,

Mohamed

---

<div class="post-metadata">

**Author:** ![Jesus\_Suniaga](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Jesus\_Suniaga](https://community.deeplearning.ai/u/Jesus_Suniaga)\
**Post date:** [August 6, 2022, 10:21pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/12 "2022-08-06T22:21:44Z")

</div>

Thanks for the advise. I beg your pardon for my ignorance about it.  
I have a question. What do You mean for a notebook.? I thought that a notebook may be colab notebook. Could You give me an example

---

<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:** [August 7, 2022, 1:55am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/13 "2022-08-07T01:55:09Z")

</div>

Open your notebook on coursera, click “File” \> “Download as” \> “notebook”. Then your notebook is downloaded. Click the profile of @mrafat, you will see a “Message” button, click the button to start drafting a message, attach your downloaded notebook to the message.

---

<div class="post-metadata">

**Author:** ![mrafat](https://sea1.discourse-cdn.com/dlai/user_avatar/community.deeplearning.ai/mrafat/32/21026_2.png) [@mrafat](https://community.deeplearning.ai/u/mrafat)\
**Post date:** [August 8, 2022, 1:21am UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/14 "2022-08-08T01:21:46Z")

</div>

Thanks for the clarification @rmwkwok

---

<div class="post-metadata">

**Author:** ![Jesus\_Suniaga](https://avatars.discourse-cdn.com/v4/letter/j/f04885/32.png) [@Jesus\_Suniaga](https://community.deeplearning.ai/u/Jesus_Suniaga)\
**Post date:** [August 8, 2022, 1:20pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/15 "2022-08-08T13:20:54Z")

</div>

Ok . I did it. I apreciate your help soon, since the course finishs on August 15. Thanks a Lot  
Sincerely tours  
Jesús Suniaga

---

<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:** [August 10, 2022, 6:11pm UTC](https://community.deeplearning.ai/t/week-2-assignment-error/176557/16 "2022-08-10T18:11:42Z")

</div>


