I checked the video and it should be element-wise multiplication!
I fixed the error by using np.dot.
If you watch the video at minute 8:45 you can see
Z is a dot product because it is written with np.dot.
But dw is NOT written with np.dot even though it should to be a dot product!
Why???
Hey @Florian_Enders,
Welcome, and we are glad that you could be a part of our community
Just to make sure I am on the same page as you, the error is in one of the lecture videos in Week 2, and not in W2 A2. Can you please let us know to which lecture video are we referring to?
Cheers,
Elemento
It can be a bit ambiguous sometimes, but you have to pay close attention to whether Prof Ng is writing code or writing math formulas. And sometimes he even mixes the two on a given slide.
In the case of math formulas, he uses the convention that * indicates elementwise multiply and just writing the operands adjacent to each other with no explicit operator means dot product style matrix multiply. Here’s a thread which goes through this in more detail.
Here’s what it shows in the notebook:
It’s pretty clear those are math formulas and not python, right? What does \partial J mean in python? Or \sum?
So the operation between X and (A - Y)^T is dot product by the conventions described on that thread I linked.