C4 W2 A1-Identity block : no of channel in Input (n_c) and no of Filter F3

In 2nd Week assignment of CNN course, there is an exercise to make identity block.

Two of its arguments are input layer X with shape (m n_h ,n_w , n_c) and filters which contains filter F3.

My doubt is that F3 and n_c must be equal such that dimensional compatibility for Add function is satisfied when adding X_Shortcut and X.

As X_Shortcut has dimension (m n_h ,n_w , n_c)
and after multiple operation dimension of X becomes (m, n_h, n_w, F3).

Hi Faraz,

not sure if you just want a confirmation or something else. In that specific case yes. I also see that the shape of both tensors in Add() needs to be the same. When checking the Conv2D() documentation, the filters argument is the number of output filters in the convolution so I guess you are right and the F3 parameters needs to be the same a n_c otherwise you would get an error when trying to add them.

Happy learning,


Thanks!!! I just needed the confirmation.