I am stuck at week 2 graded assignment exercise 6 “Optimize” function.
I am sure that my code is correct but it is giving Assertion Error. The propagate function works fine. Please help me.
Below are propagate and optimize codes:
Your code for the “update parameters” logic is incorrect. Please have a more careful look at it. The incorrect update is the reason that the shapes end up going bad. I’ll bet if you print the shape of dw, you’ll find that it’s correct on the first iteration and then mutates after that.
Note that we aren’t supposed to share solution code in a public way. But when you show any kind of code you need to use the </> formatting tool, so that the code doesn’t get interpreted as “markdown”. For example * means italic in markdown, so the code is not really legible as code. I edited the post twice: once to format the code so that I could really “see” it and then again to remove the code. You should be able to see my edits if you click the little edit pencil to see what I mean about the markdown.