C5W1 Exercise 5 - rnn_cell_backward

if anyone can help me that why dxt = np.dot(Wax,dtanh) shows not correct?

as i checked over and over again, don’t know about the mistake.


ValueError Traceback (most recent call last)
in
12
13 da_next_tmp = np.random.randn(5,10)
—> 14 gradients_tmp = rnn_cell_backward(da_next_tmp, cache_tmp)
15 print(“gradients[“dxt”][1][2] =”, gradients_tmp[“dxt”][1][2])
16 print(“gradients[“dxt”].shape =”, gradients_tmp[“dxt”].shape)

in rnn_cell_backward(da_next, cache)
33
34 # compute the gradient of the loss with respect to Wax (≈2 lines)
—> 35 dxt = np.dot(Wax,dtanh)
36 dWax = np.dot(xt,dtanh)
37

<array_function internals> in dot(*args, **kwargs)

ValueError: shapes (5,3) and (5,10) not aligned: 3 (dim 1) != 5 (dim 0)

i figured out this one,

I had the same issue. I missed the transpose in the equations.