# UNQ_C1
# GRADED FUNCTION: compute_cost
goes in the cell with the compute cost function.
def compute_cost(x, y, w, b):
# UNQ_C1
# GRADED FUNCTION: compute_cost
goes in the cell with the compute cost function.
def compute_cost(x, y, w, b):
Thanks,
I didnât change anything and I let it run the 20th time and than it worked finally. I couldnât find any misstake.
Previous I was locked out and I couldnât resign in. I closed the safari and reopened the course again for continuing. It was a multi hour time consuming interfering - maybe Coursera Jupiter notebook does not like Safari. Who knowsâŚ
Now I can continue
I may need you another time.
Thank you
Tamara Stauch
I wished I had found these post a few weeks ago, better late than never. Iâm also having problems with practice lab assignment 2. I believe I had thae correct code, checked it several times, reviewed previous optional labs and lectures, but auto graded failed my assignment. In retrying the assignment I might have messed-up the code that was given to us. Is there a way to get a partial reset, or total reset of the assignment. Also I got pulled a way from the course for a few weeks, to that end can deadlines be reset?
Hello Joshua @Joshua_Neft,
Please follow these steps to get a fresh copy of the assignment, and then you may copy your work from your current notebook to the fresh one.
Please read this coursera post about resetting deadlines. However, the deadlines are only for your own reference, and does not affect your grade nor certificate. You may just finish any overdue quizzes or assignments now without resetting deadlines, and you can receive full marks as long as all questions/exercises are correct.
Cheers,
Raymond
It looks like you deleted the comment.
# UNQ_C2
# GRADED FUNCTION: compute_gradient
it should go here
# UNQ_C2
# GRADED FUNCTION: compute_gradient
def compute_gradient(x, y, w, b):
I have a similar issue. I have passed all the tests within the assignment but on compiling the code I get the error: Canât compile the studentâs code. Error: NameError(âname âcompute_costâ is not definedâ). I rechecked the code and the function has been defined so not sure why this error is occuring. Please advise.
Hello @vartika_rawat,
compute_cost
being defined is not sufficient to get rid of that error. compute_cost
has to be defined before any code line calls it. If you use Chrome, I suggest you to press âCtrl + Fâ on your keyboard, and search for âcompute_costâ, then make sure it is defined before any calls. On my notebook, the search results in 9 matches, the first 3 matches are text or comments which donât matter. The 4th match is the define line. The 6th, 8th, and 9th matches are lines that call the function.
Everyone should see the same search result patten, and if you donât, you might have changed the assignment notebook, or you have made a call in your assignment work before the function is defined which is unexpected.
Cheers,
Raymond
Thanks Raymond. In my assignment file, the function is being called before it is being defined but I am unable to edit the code in that section as it is the predefined test code which cannot be edited. Please see attached.
Hello @vartika_rawat,
Thank you for the screenshot! Itâs very helpful.
The notebook originally looks like this:
So, above the code cell for def compute_cost(.....)
it is the description of the exercise. From your screenshot I think you might have moved some code cells. We are not supposed to move any code cell, but I believe you might have done it unintentionally.
I would therefore suggest you to refresh the notebook to its original state by following these instructions. It will ask you to rename your current notebook before the system can get you a new notebook. After you get a new notebook, then you may copy your work back from the current notebook to the new notebook.
Cheers,
Raymond
Thanks. That worked!
Thatâs great, @vartika_rawat!
Raymond
I am also facing the same issue how I send you the code sir
Hi!
Please start a new thread with your question, this thread is almost a year old.
I have finished the assingment and I firmly believe the code is totally fine, the editor still keeps failing me even though I pass the tests, this is such a waste of my time and resources, extremely disappointed.
If your code fails the grader, it usually means your code has defects.
When grader fails you, it also gives you the reason why it is failing you. Click on âShow grader outputâ and share that feedback with us.
Just says cannot compile code
{Moderator Edit: Solution Code Removed}
Please note that sharing your code is against the community code of conduct. So, avoid sharing your code.
Kindly share the screenshot of the âShow grader outputâ and any error you see in your notebook.