CNN Implementation In Keras: tk.keras.layers.Conv2D()
Class Structure Of Conv2D:
tf.keras.layers.Conv2D(filters, kernel_size, strides=(1, 1), padding=”valid”, data_format=None, dilation_rate=(1, 1), groups=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, **kwargs)
The commonly used arguments of tk.keras.layers.Conv2D() filters, kernel_size, strides, padding, activation.
Arguments |
Meaning |
---|---|
filters | The number of output filters in the convolution i.e., total feature maps |
kernel_size | A tuple or integer value specifying the height and width of the 2D convolution window |
strides | An integer or tuple/list of 2 integers, specifying the strides of the convolution along with the height and width. |
padding | “valid” means no padding. “same” means output has the same size as the input. |
activation | Non-Linear functions [relu, softmax, sigmoid, tanh] |
use_bias | Boolean, whether the layer uses a bias vector. |
dilation_rate | an integer or tuple/list of 2 integers, specifying the dilation rate to use for dilated convolution. |
kernel_initializer | Defaults to ‘glorot_uniform’. |
bias_initializer | The initializer for the bias vector |
kernel_constraint | Constraint function applied to the kernel matrix |
bias_constraint | Constraint function applied to the bias vector |
Python Tensorflow – tf.keras.layers.Conv2D() Function
In this article, we shall look at the in-depth use of tf.keras.layers.Conv2D() in a python programming language.