Problem with Week 3 Lab - Passes tests in Notebook, but wrong when graded

I just finished the assignment and my implementation passed all the tests in the notebook, but the grader marked questions 5 and 6 incorrect

Code Cell UNQ_C5: Function ‘compute_cost_reg’ is incorrect. Check implementation.
Code Cell UNQ_C6: Function ‘compute_gradient_reg’ is incorrect. Check implementation.

I’m not sure how to fix this issue. I did vectorize my solutions, but that hasn’t been a problem in any other notebook so far and every other solution I have submitted has been vectorized.

This means your code doesn’t work correctly for the data set and tests that the grader uses.

Passing the tests in the notebook does not prove your code is perfect.

Common issues are using fixed-constants for the data set size, or using global variables that the grader doesn’t support.

I figured out the issue. Apparently my functions for those questions didn’t save. I’m not sure why.

1 Like

The auto-save for notebooks is very slow. Best to use “File->Save and Checkpoint” before you submit for grading.

1 Like