W4_A1_Failing tests

here is my code… i am unable to find the mistake in this code. this is the last assignment of course 1 week 4

{moderator edit - solution code removed}

def plot_costs(costs, learning_rate=0.0075):
plt.plot(np.squeeze(costs))
plt.ylabel(‘cost’)
plt.xlabel(‘iterations (per hundreds)’)
plt.title(“Learning rate =” + str(learning_rate))
plt.show()

Hi @Arita_Halder ,

I would look at the compute_cost function.

It seems you are implementing it here, but you defined it before, right? try reusing the one you implemented, as indicated by the lab.

Also, please remove your code - it goes against the code of honor to post code.

Thanks,

Juan

Hi @Arita_Halder ,

The problem is in calculating the cost. Multiplying two matrices element-wise is different form matrix multiplication which uses the dot product operation. If you read the implementation instruction, it suggested to use the comput_cost() function that you have already implemented in the previous lab. All you have to do is just call the function and pass in the parameters. The function is linked to the lab notebook, please see the import statement at the top:
from dnn_app_utils_v3 import *

1 Like

thank you so much… it worked… i missed that instruction and mistakenly wrote the whole formula

thank you so much… it worked… i missed that instruction and mistakenly wrote the whole formula

1 Like