I cannot get rid of this error:
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-57-5b9326f2c416> in <module>
14 parameters_tmp['by'] = np.random.randn(2, 1)
15
---> 16 a_tmp, y_tmp, c_tmp, caches_tmp = lstm_forward(x_tmp, a0_tmp, parameters_tmp)
17 print("a[4][3][6] = ", a_tmp[4][3][6])
18 print("a.shape = ", a_tmp.shape)
<ipython-input-56-f64054808a3c> in lstm_forward(x, a0, parameters)
51 xt = x[:,:,t]
52 # Update next hidden state, next memory state, compute the prediction, get the cache (≈1 line)
---> 53 a_next, c_next, yt, cache = lstm_cell_forward(xt, a_next, c_next, parameters)
54 # Save the value of the new "next" hidden state in a (≈1 line)
55 a[:,:,t] = a_next
<ipython-input-20-598d0d575d68> in lstm_cell_forward(xt, a_prev, c_prev, parameters)
56 it = sigmoid(np.dot(Wi, concat)+bi)
57 cct = np.tanh(np.dot(Wc, concat)+bc)
---> 58 c_next = ft*c_prev + it*cct
59 ot = sigmoid(np.dot(Wo,concat)+bo)
60 a_next = ot*np.tanh(c_next)
ValueError: operands could not be broadcast together with shapes (5,10) (10,10)
My initializations of inputs for the lstm_cell_forward
are:
a_next = a0
c_next = np.zeros((n_a, m))
What may be a problem here?