Weak 2, Residual Networks

Unable to implement Identity_Block() function:

AssertionError Traceback (most recent call last)
Input In [27], in <cell line: 28>()
23 A4 = identity_block(X, f=2, filters=[3, 3, 3],
24 initializer=lambda seed=0:constant(value=1),
25 training=True)
26 print(np.around(A4.numpy()[:,(0,-1),:,:].mean(axis = 3), 5))
—> 28 public_tests.identity_block_test(identity_block)

File /tf/W2A1/public_tests.py:31, in identity_block_test(target)
28 resume = A3np[:,(0,-1),:,:].mean(axis = 3)
30 assert np.floor(resume[1, 0, 0]) == 2 * np.floor(resume[1, 0, 3]), “Check the padding and strides”
—> 31 assert np.floor(resume[1, 0, 3]) == np.floor(resume[1, 1, 0]), “Check the padding and strides”
32 assert np.floor(resume[1, 1, 0]) == 2 * np.floor(resume[1, 1, 3]), “Check the padding and strides”
33 assert np.floor(resume[1, 1, 0]) == 2 * np.floor(resume[1, 1, 3]), “Check the padding and strides”

AssertionError: Check the padding and strides

Please read the instructions and your code again. It is normal to make mistakes on the first attempt but if you read it again, you will catch it.
One common mistake is: the kernel size of the second component of the main path is not 1.

But I have set kernel size of the second component of the main path to f.
I have read the instructions many time, but I am unable to find mistake.

Please send me your code of identity_block function in a private message. Click my name and message.

Please note that, for Ex. 1, the notebook says that:

The first component of the main path has been implemented for you already! First, you should read these docs carefully to make sure you understand what’s happening. Then, implement the rest.

It means read the first component of the main path code. Understand it. And do the same code for the rest of the components with some changes like kerne_size, padding, etc.

Simple. Easy peasy lemon squeezy.