Week - 4 Exercise 6

Hi there,

I am pasting here my error from week - 4.
I have also tried to do it with np.dot but its giving me error in that as well.

previously, I was thinking may be I had errors in previous cell that’s why it is happening but that cell is now working completely fine.

Can you please let me know what I am missing?

Thanks !

Hi @Sadhana_Verma,

Please take a look at this equation and implement it the way it shows, but do remember to include the transpose where it is required. And also, implement it using np.dot and not np.sum.
Screenshot 2022-09-07 at 4.56.08 PM

Best,
Mubsi

Well, you can also do it as a two step process: multiply (elementwise meaning *) followed by np.sum. But the way you used np.sum is not correct: you gave it two arguments which are both arrays. The second argument is supposed to be something other than an array e.g. a specification of which axis to use or “keepdims” or the like. That’s what that error message is telling you: it didn’t like the arguments you gave.

Have a look at the documentation by googling “numpy sum”.