GRADED FUNCTION: conv_block
def conv_block(inputs=None, n_filters=32, dropout_prob=0, max_pooling=True):
“”"
Convolutional downsampling block
Arguments:
inputs -- Input tensor
n_filters -- Number of filters for the convolutional layers
dropout_prob -- Dropout probability
max_pooling -- Use MaxPooling2D to reduce the spatial dimensions of the output volume
Returns:
next_layer, skip_connection -- Next layer and skip connection outputs
"""
# conv = Conv2D(None, # Number of filters
# None, # Kernel size
# activation=None,
# padding=None,
# kernel_initializer=None)(inputs)
# conv = Conv2D(None, # Number of filters
# None, # Kernel size
# activation=None,
# padding=None,
# kernel_initializer=None)(conv)
# YOUR CODE STARTS HERE
conv = Conv2D(32,3,activation='relu',padding='same',kernel_initializer='he_normal')(inputs)
conv = Conv2D(32,3,activation='relu',padding='same',kernel_initializer='he_normal')(conv)
# YOUR CODE ENDS HERE
# if dropout_prob > 0 add a dropout layer, with the variable dropout_prob as parameter
if dropout_prob > 0:
# conv = None
# YOUR CODE STARTS HERE
# YOUR CODE ENDS HERE
conv=Dropout(dropout_prob*0.5)(conv)
# if max_pooling is True add a MaxPooling2D with 2x2 pool_size
if max_pooling==True:
# next_layer = None
# YOUR CODE STARTS HERE
next_layer =MaxPooling2D((2,2))(conv)
# YOUR CODE ENDS HERE
else:
next_layer = conv
skip_connection = conv
return next_layer, skip_connection
i have created this model but getting error in test so please help me to overcome this problem(Week 3 in CNN Program Assignments)