C2 W3 Graded Assignment

Hi

“I am experiencing some test failures in my unit tests. After reviewing my code and the class structure, I suspect the failures may be due to the weights being initialized with random values. I’ve spent a week on this issue and feel confident about my formulas, assuming I haven’t misunderstood the class setup. Are these random initializations likely to cause problems, or are they acceptable?”

Exercise 5

Test case “default_check”. Wrong output of compute_cost.
Expected:
0.6931477703826823
Got:
0.760096502985921
1 Tests passed
1 Tests failed

Exercise 6
image

The tests are designed to work even if the random values are different. It all worked for me. So my guess is that your code is incorrect.

To get things in a consistent state, try these steps:

  1. Kernel → Restart and Clear Output
  2. Save
  3. Cell → Run All

Now look at the output of the compute_cost test. Here’s what I see when I do that:

No, that’s not the problem. The tests have been well-exercised by now, since the course is quite old. Errors thrown by the test cases indicate problems in your code.

Thanks will leave this section and restart it when I have a perspective,

Thanks TMosh i will come back with a fresh perspective. might have overlooked the section