The dimensions on that dot product are obviously wrong. So there must be something in the earlier computations that is wrong. Have you compared them carefully to the formulas shown in the instructions?

Just posting your code and expecting us to fix it for you is a) against the rules and b) robs you of the experience of learning how to debug. Once you finish these courses and try to do this stuff “for real”, who is going to do your debugging for you?

One important thing to realize is that when Prof Ng uses “*” as the operator, that is elementwise multiply, not dot product. That is what the issue is here. You have used the wrong operation, which is why it fails.

Once you fix that, you need to carefully check your code for ot and a_next as well. Both are incorrect.

Hi Gabriel, I made the same mistake. I found the instructions for the lab misleading , as we were told explicitly to use np.dot to multiply matrices. But for c<t> and a<t> we must use “*” (element-wise multiply).

Prof Ng is very consistent in his notation. If and only if he uses “*” in the mathematical expression does he mean “elementwise” multiply. When he means dot product style multiply, he simply writes the operands adjacent to one another with no explicit operator. So the information is all there in an unambiguous form if you are careful to observe what is written.