Hi, I finished the assignment but I have a question about a solution that I apply to avoid errors. I built my cost function step by step then I merged it in one line to make forward and backward propagation. However, I did change the position of line ‘cost = np.squeeze(np.array(cost))’ in my code which was outside of the space for coding. I don’t understand what does np.squeeze in the code and why I had to move it to avoid errors. The code line is:

cost = -np.sum(np.squeeze(np.array(np.multiply(Y, np.log(A)) + np.multiply((1 - Y), (np.log(1 - A))))), axis = 0)/m

Thanks for your help.