Programming assignment 1 completed - but still a problem w/ np.dot() in propagate

The cost formula is just a math formula. Now you need to do two steps: translate that into vector operations and then express those vector operations in numpy code. There are basically two approaches:

  1. Elementwise multiply, followed by summing the products.
  2. You can do it in one step with a dot product.

But if you choose option 2) then you need to understand how dot products work. The “inner” dimensions need to agree. So if both your vectors are 1 x 3, then one of them must be transposed. But even there, there are two ways to do it and only one of them does what you want in this case. Here’s a thread which shows a concrete example of what I mean by that.