Costs Assertion Error for optimization function

Costs returns the list [array(5.801),array(nan)] instead of the list [array(5.801),array(0.310)]
I getting cost by taking: grads, cost and equaling it to the propagate function
<grads, cost = propagate(w, b, X, Y)>

The propagate function already passed all tests, and the only way I could think of a potential error is with the cost equation supposed to be using instead of the element wise multiplication I was using, but if was used for matrix multiplication A having shape (1,3) and Y having shape (1,3) would cause an error.

Check how you update w and b. This could also pose an error.

A transposition might fix this.

My w and b parameters where updated by


This is incorrect. Check the below image from the assignment:

Thank you so much