Hello, I encountered this error while running the public test. Is this possible while the two tests above yield the correct value?
Thank you
Yes, it is possible. There are multiple tests.
This means your cofi_cost_func() function does not return the correct value for the test defined in test_cofi_cost_func().
Hello, what do you suggest to fix this? I’m not sure where the error occurred in my code.
found the problem, thanks
Could you please tell us how you solve it?
Need help here!
The regularization term matches with the hints provided but the output does not match.
@Sumaiya639, did you use all of the hint code?
hello, instead of using b_j as defined, I mistakenly used b in the equation.
check your cofi_cost_func equation. In the ‘for i’ loop I think the r term should be outside the np.square() instead of inside like the one in hint.
Yeah,
I used regularization term outside the loop then it worked.
Thanks
I am facing the same issue. How did you fix the issue?
hello, please check your cofi_cost_func equation. Try to move the ‘r’ term outside np.square() instead of inside like the one shown in the hint.
I believe the hint code is correct.
Note that your result is exactly 2x the correct value. Maybe that is significant.
Thank you.
I moved r function outside i loop and non-regularized and regularized output is correct now.
But i still see issues when i ran the third one. I still see an error there, I am not sure if I am missing anything still…
I got it now
I forgot to implement r outside np.square, now i did and it worked.
Thanks a lot
I am unsure of what you mean by moving the ‘r’ term outside np.square().
Could you please explain?
I did this way and worked!
{Mentor edit: code removed: Sharing your code on the forum is not allowed by
the Code of Conduct}