C5W1 A1 (Ex8) lstm_backward, dc_next missing?

I have a trouble merging lstm_cell_backward in lstm_backward because the former requires dc_next but the latter exercise(lstm_backward) does not provide it. Maybe I have missed something. Please advise me.

Thanks, Youngha

How did you solve this in rnn_backward?

You see that da_prev is da_next for the previous timestep. The same is true for dc_prev and dc_next.

You also need to take into account da[:,:,t] when calling your backward cell functions.

I got that part but I have an broadcast error calling lstm_cell_backward apparently from the argument da[:,:,t]+da_prevt. I couldn’t figure out the reason yet.

Your call looks correct, so maybe you have a problem where you update da_prevt, which gives incompatible dimensions.

you’re right but I don’t understand because Wf^T * dft gave the dimension as [8, 10]. That makes sense from 8 = 5 + 3, where n_a = 5, and n_x = 3. Wf was extracted by parameters[“Wf”]. Maybe eq. 19 was not correct?

Can I have a look at your implementation?

{moderator edit - solution code removed}

Can you also supply lstm_backward(da, caches)

{moderator edit - solution code removed}

is not correct.

Oh my bad. Thank you so much. It was the last one assignment that I was working on.

1 Like

Doesn’t that instruction seem unclear or wrong though? like what is W[:,: na] is it missing a comma or is there something I’m unaware of?

I’ve replied to your original post. Kindly check it here.

Best,
Saif.

1 Like