It’s great to hear that you figured out the issue here and that it was just a misunderstanding of the notation. Note that there are two forms of matrix multiplication: the usual “dot product” style and also there is “elementwise” multiplication which is used in some cases. It is worth taking a look at this thread which explains the notation that Professor Ng uses to distinguish those two very different operations. Note that you can also find that as one of the topics on the DLS FAQ Thread, which is worth a look if you are just getting started on DLS.