Error in convolutional block

glorot_uniform is a function provided by TF. It is imported in the import cell that is the first executable cell in the notebook. Here is the documentation.

initializer is the variable name given to one of the optional parameters in the function definition of convolutional_block. The default value specified for that parameter is glorot_uniform.

kernel_initializer is the variable name of one of the optional parameters of the function Conv2D, which is also a TF function imported by the import cell in this notebook. Here is the documentation.

With the above in mind, now go take another look at the source for the convolutional_block function and it should make sense. But you probably first want to get a clean copy without your changes, because you have incorrectly modified the examples they gave you in the template code of how to correctly invoke Conv2D. There is a topic about that on the FAQ Thread.

The overall point here is that the variable initializer is the parameter to convolutional_block that should determine what initializer function is passed to Conv2D. But the way you have changed the code, it will always pass glorot_uniform, regardless of what value is passed in to convolutional_block at the top level. That is a bug, although it may not have any ill effect as long as you don’t try to use a different initializer than glorot_uniform.

1 Like