In this exercise, I’m getting “wrong value for a” message.
my a values are a[4][3][6] = 0.1786306327904998, while what’s expected are
a[4][3][6] = 0.172117767533.
My y values are: y[1][4][3] = 0.9470058898412564, while what are expected are y[1][4][3] = 0.95087346185
and etc.
Why the difference? Thanks!
Those differences are not rounding errors, so there must be something wrong in your implementation. It’s a bit hard to say what that is, just based on the different values, of course. My first suggestion is just to read through the instructions for that function again carefully and compare that to what your code actually does. If that doesn’t shed any light, then we’ll go to the next step after that.
Thanks! the wired thing is that my previous step lstm_cell_forward function all returned correct value to the 8th digit after decimal. In this function, I only initiated:
a = np.zeros((n_a,m,T_x))
c = np.zeros((n_a,m,T_x))
y = np.zeros((n_y,m,T_x))
and
a_next = np.zeros((n_a,m))
c_next = np.zeros((n_a,m))
all other output are from lstm_cell_forward function.
Well, you have to pass the correct inputs to lstm_cell_forward
.
Here is the part passing the input to lstm_cell_forward:
xt = x[:,:,t]
a_next, c_next, yt, cache = lstm_cell_forward(xt, a_next, c_next, parameters)
That all looks correct. Probably best to just look at your whole notebook. Please check your DMs for a message from me about how to do that.