Seems like your code may be missing a transposition.
I think you don’t need transposition. The bug is in your nn_model
code when you call forward_propagation
function. What should be the order of return and what should be the input arguments? Perhaps go back and understand Ex. 4.
I appreciate your response, but the main problem was in parameters1 function when I implemented n_x and n_y as X.shape[1]/Y.shape[1]
Yes, that would cause issues. Glad to hear you fixed that problem. But Saif is also right that there are other issues in the line that invokes the forward_propagation
function. I hope you also sorted those out. Note that the function returns 2 return values, right? You need to check the definition of the function (look at the return statement in particular). Also why are you appending cache["A2"]
there? I would expect that to throw a “Variable referenced before assignment” exception, because the RHS of an assignment statement is evaluated before the LHS.
yeah i fixed that, thanks one more