Course 2 Week 1 Grad check

i cannot understand what does this “i” mean in this slides. And what does the \theta_1 \theta_2 means in this formular?

In order to implement Gradient Checking, they “unroll” all the parameters (all the W and b values) into a single vector which they call theta. Then they step through that vector and perturb each element individually to compute the “finite difference” approximations of the gradients.

Thank you very much! Now i understood how grad check works. :smiling_face_with_three_hearts:

However, as you said, the single \theta, that without any subscript numbers, are the combine of all the parameters that is W and b. But my questions is, if we unroll the single \theta, we should have a lot of W and b of different layers instead of such a lot “\theta_1” “\theta_2” with subscript numbers. So what should “\theta_1” means, that is, for example, \theta_1 = ?

In the mean time, i should be what? that is, the range in the for loop above is from 1 to what ?

Thank you very much if you could answer my 2 questions above! :pleading_face:

The elements of theta are the unrolled elements of all the W and b values for all the layers. So the index steps through those elements in order. The total number will be the sum total of the number of elements in all the W and b values for all the layers of the network. See the routines dictionary_to_vector and gradients_to_vector and take a look to see how they work if you want to understand this at the next deeper level.

Thanks a lot! And after i finish the exercise i finally got it! :grinning_face_with_smiling_eyes: