Hi there,
I am working on C3_W2. The code passed the test without regularization but when I include regularization parameter it does not work. I am including the regularization term but still getting an error. I am getting AssertionError: Wrong value. Expected 27, got 270.0. Check the regularization term. Seems like the cost of non-regularization is 0 when I put regularization term.
The regularized functions start by calling the non-regularized functions, then you add code to compute the regularized parts, and add them to the unregularized parts.
I am not sure what you mean here. Since we are not allowed to post code here, asking again:
The code without regularization works. When I add the code for regularization (and keep the non-regularization code), I get 157.90 (Cost with regularization) whereas the expected output is 28.09 ).
When I comment out the non-regularization code and just have the regularization code, I get an output of 144.23 as cost with regularization.
Unsure what else to do. Please provide Hints. Thanks.
I went back to the class notes to look at the cost function and think the code is doing what we learned but not giving the correct results with regularization: {moderator edit: code removed}
Please check out this post and pay attention to not mixing the regularization term into the error term. Note the two brackets in the formula. We finish computing the first bracket, and then we compute the second, and finally add both together.
Hey! hop you all doing fine, I’m getting this error in test case, can anyone suggest me what is going wrong depite the code produces the same expected values, I’m getting confused about it.I can’t even change the atol=1e-8 to higher accuracy in testcasefiles. where should I look for this error in my code??