dWaa value of rnn_cell_backward

Hi,

I got a mismatch of Expected value of dWaa, other outputs seem ok, it this ‘normal’? or something wrong ?

gradients[“dxt”][1][2] = -1.3872130506020925
gradients[“dxt”].shape = (3, 10)
gradients[“da_prev”][2][3] = -0.15239949377395495
gradients[“da_prev”].shape = (5, 10)
gradients[“dWax”][3][1] = 0.4107728249354584
gradients[“dWax”].shape = (5, 3)
gradients[“dWaa”][1][2] = 1.0470184237718851 vs 1.15034506685
gradients[“dWaa”].shape = (5, 5)
gradients[“dba”][4] = [0.20023491]
gradients[“dba”].shape = (5, 1)

Expected output…
gradients[“dxt”][1][2] = -1.3872130506
gradients[“dxt”].shape = (3, 10)
gradients[“da_prev”][2][3] = -0.152399493774
gradients[“da_prev”].shape = (5, 10)
gradients[“dWax”][3][1] = 0.410772824935
gradients[“dWax”].shape = (5, 3)
gradients[“dWaa”][1][2] = 1.15034506685
gradients[“dWaa”].shape = (5, 5)
gradients[“dba”][4] = [ 0.20023491]
gradients[“dba”].shape = (5, 1)

Please look at the equation carefully.

dW_{aa} = dtanh \cdot {a^{t-1}}^T

You need to transpose “a_prev”, not “da_prev”. :slight_smile:

Thank you !

you are life saver… :sweat_smile: What a stupid mistake !