There are many different data structures in python. You have to look at the code and understand which one is being used. Did you read the template code that I pointed out? Just because parameters is a dictionary, that doesn’t many that any other particular variable is also a dictionary.
The particular code that references parameters is retrieving the weight matrix for a particular layer. The keys for those are the string names W1, W2 and so forth. You have the layer number in a variable l and you want to create a string that starts with W and includes the layer number. One easy way to do that in python is “W” + str(l). What the str() function does is convert whatever the argument is to a string. And what the + operator means for strings is concatenation.
@paulinpaloalto, very well explained sir. Thank you for this clarification. These short inputs and clarifications are so useful for us as well. Keep shining!
The other point here is that python is an interpreted language. It is interactive. You don’t have to wonder what something does: you can try it and see. For example, if you want to know what type caches is, do this:
print(f"type(caches) = {type(caches)}")
If you want to understand what “W + str(l)” does try some examples: