I’m on Exercise 8 and all of my codes pass up until the nn_model portion. I’ve checked with a friend of mine who is also taking the course and we have the same lines of code, but I’m getting an error and he isn’t. I don’t understand what I’m doing wrong. Can someone please share some insight/correct me?
Code:
Error:
ValueError Traceback (most recent call last)
in
1 t_X, t_Y = nn_model_test_case()
----> 2 parameters = nn_model(t_X, t_Y, 4, num_iterations=10000, print_cost=True)
3
4 print("W1 = " + str(parameters[“W1”]))
5 print("b1 = " + str(parameters[“b1”]))
in nn_model(X, Y, n_h, num_iterations, print_cost)
44
45 # YOUR CODE STARTS HERE
—> 46 A2, cache = forward_propagation(X, parameters)
47 cost = compute_cost(A2, Y)
48 grads = backward_propagation(parameters, cache, X, Y)
in forward_propagation(X, parameters)
32 # A2 = …
33 # YOUR CODE STARTS HERE
—> 34 Z1 = np.dot(W1,X)+b1
35 A1 = np.tanh(Z1)
36 Z2 = np.dot(W2,A1)+b2
<array_function internals> in dot(*args, **kwargs)
ValueError: shapes (4,5) and (2,3) not aligned: 5 (dim 1) != 2 (dim 0)