I keep getting the wrong output for dj_db and dj_dw initial input values w & b zeroes.

The code is running without errors it but still ge the wrong output. Cannot see where it goes wrong as I have used all hints.

dj_db at initial w and b (zeros):-0.005050505050504951

dj_dw at initial w and b (zeros):[-0.3766963389152976, -0.4509304870421179]

**Expected Output**:

|**dj_db at initial w and b (zeros)**|-0.1|

|**dj_dw at initial w and b (zeros):**|[-12.00921658929115, -11.262842205513591]|

I have spent so many hours already on trying to fix this - could someone please guide me forward?

Hi @Tanja_Souza

Welcome to the community!

Make sure from your implementation of the function compute_gradient(), and you passed all test cases before it ,Also may you had divide the variables \partial{dw} ,\ \partial{db} many time by m(number of training examples) after each iteration, you should divide the variables \partial{dw}, \ \partial{db} only once before return

Note you can check the hint below

Best Regards,

Abdelrahman

1 Like

Unbelieveble - that did the trick! As all previous tests passed correctly I was struggling to find where it went wrong i my code. It was actually the code rows dividing dj_dw and dj_db with m in the end that had the wrong indentation! I am fairly new at python so making newbie mistakes

@Tanja_Souza Don’t say that I am pleasure to help you and know that you learn more and more techniques

Best Regards,

Abdelrahman