Problem with week 2 | Practical Assignment

I am having a hard time implementing the equation. Can someone give me a bit of insight into this?

Understanding the difference between and normal multiplication using * should help clear this. I added another cell below the submission code and tried it out in real time which helped immensely

Hi @janageeth
In addition to the comments of @prasunjha, please check your implementation of cost and db compared with the formulation provided at the start of the exercise.

I did just that. But I am still having an issue. Can you please help me?

Hi @janageeth, the error message says that you are trying to multiply shape 1x3 * 1x3 which is not correct. Please check your implementation with the provided formula to find out where is the issue.


I faced a very similar issue. The key is understanding the difference between * multiplication and * is used for element wise multiplication. So, a (1,3) array is compatible with another (1,3) array. However, if we use, its matrix multiplication, which means array1.shape[1] needs to be equal to array2.shape[0]. That is to say, for, you need (1,3) and (3,1) as the array shapes.

Hi @janageeth, please be aware that you should not post your code here :slight_smile: could you please edit your post to remove it?

Done! Thank you for letting me know