Week 4, Assignment 1, Exercise 5

Hi everyone,

probably a rather stupid question but I got stuck on the exercise with L_model_forward.
I’m trying to call the linear_activation_forward function from above but I somehow can’t manage to get W and b. Do you have any idea what I could be doing wrong and how I can get the values from the parameters list?

Thanks in advance!

The parameter values (all the W^{[l]} and b^{[l]} values) are in a dictionary called parameters, right? We’ve seen plenty of examples of how to access the entries in a dictionary earlier in this notebook. E.g. look at the function initialize_parameters_deep that we built earlier. It’s the same here, right?

So I tried accessing the dictionary with parameters[“Wl”] but this gives me “Key Error: Wl”. Do I have to call the function initialize_parameters_deep ?

This is wrong. As Paul said, check how this task is done in initialize_parameters_deep. It will take you a few seconds to check that code. You may need to check the Instructions of that initialize_parameters_deep.

You don’t need to call that function. Just take the idea from it on how to access the W from parameters.

Thanks, I got I now!