Search code examples
tensorflowkerasdeep-learningconv-neural-networkzero-padding

What is the default kernel-size, Zero-padding and stride for keras.layers.Conv2D?


What are the default Kernel-Size, Zero-Padding, and Stride arguments in Conv2D (keras.layers.Conv2D)? What happens if these arguments are not specified?


Solution

  • You can find the documentation here: https://keras.io/layers/convolutional/

    In python you can give default values for parameters of a function, If you don't specify these parameters while calling the function, defaults are used instead.

    In the link above you'll find that Conv2D has the parameters:

    filters, kernel_size, strides=(1, 1), padding='valid', data_format=None, dilation_rate=(1, 1), activation=None, use_bias=True, kernel_initializer='glorot_uniform', bias_initializer='zeros', kernel_regularizer=None, bias_regularizer=None, activity_regularizer=None, kernel_constraint=None, bias_constraint=None
    

    only filters and kernel_size parameters must be given, others are optional or has default values next to them.