Exercise 7, first programming assignment

Title:
NameError: ‘Wf’ is not defined in LSTM Cell Backward (Exercise 7, Sequence Models, DeepLearning Specialization)

Hello everyone,

I’m working on the last course of the DeepLearning Specialization (Sequence Models) and currently on Exercise 7 (lstm_cell_backward) from Week 1 of the first programming assignment. When I try to run the code, I get the following error:

NameError: name 'Wf' is not defined

I’ve checked my code but can’t determine where the problem lies. Am I missing a specific initialization or a step in the process?

Thanks in advance!

Look inside lstm_forward and lstm_cell_forward on how you accessed Wf.

1 Like

As @balaji.ambresh mentioned, rerun the lstm_cell_forward and lstm_forward functions, Wf = parameters["Wf"] may be out of scope when you run the lstm_cell_backward function. The backward pass function should have access to the parameters used in the forward pass.