Week 3 Lab: compute_ cost_logistic_reg

I was prepared to use the coding from the optional lab entitled “compute_cost_logistic_reg”
However, the “fill in the blanks” setup and notes are entirely different, including terminology differences: the "cost"function in the optional lab is know as the “loss” function in the graded lab.
More importantly from a novice point of view, the loss (or cost) function is looped over in the i loop in the optional lab but in the j loop of the graded lab.
If you were trying to confuse me, you succeed.
If I copy the coding from the optional lab, which I understand, will it be acceptable? Mike

Ideally you’d demonstrate what you have learned by writing your own code for the practice lab.

ok, I tried that, using all of the hints. it still doesn’t run. I know you guys have given me verbatim answers in the extended hints, but it still doesn’t get the right answers. Can you look at my code? I’m really not as dumb as I may sound and I’ve spent many hours on this.

If you download your ipynb file, you can send it to me by attaching it to a private message.

I had a similar problem plus a syntax error in my code. But I had already run the entire code so I believe the input values were not default anymore. So even if I fixed my code, I received errors. Eventually I reset the script and run again, and the problem was solved. I hope it helps.

How to reset the notebook from coursera support:

  1. Rename your existing Jupyter Notebook within the individual notebook view
  2. In the notebook view, add “?forceRefresh=true” to the end of your notebook URL
  3. Reload the screen
  4. You will be directed to your home Learner Workspace where you’ll see both old and new Notebook files.
  5. Your Notebook lesson item will now launch to the fresh notebook.
1 Like