kerasadf.layers.convolutional.Conv2D

class kerasadf.layers.convolutional.Conv2D(filters, kernel_size, strides=1, padding='valid', data_format=None, dilation_rate=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)

Bases: kerasadf.layers.convolutional.Conv

2D convolution layer (for example spatial convolution).

Assumed Density Filtering (ADF) version of keras.layers.Conv2D.

Parameters
filtersint

Dimensionality of the output space (i.e. the number of filters in the convolution).

kernel_sizeint or tuple of int or list of int

An integer or tuple/list of two integers, specifying the width and height of the convolution window.

stridesint or tuple of int or list of int, optional

An integer or tuple/list of two integers, specifying the stride lengths of the convolution. Specifying any stride value != 1 is incompatible with specifying any dilation_rate value != 1. Default is 1.

padding{“valid”, “same”}, optional

The padding method. Case-insensitive. Default is “valid”.

data_format{“channels_last”, “channels_first”}, optional

The ordering of the dimensions in the inputs. “channels_last” corresponds to inputs with shape (batch, height, width, channels) while “channels_first” corresponds to inputs with shape (batch, channels, height, width). It defaults to the image_data_format value found in your Keras config file at ~/.keras/keras.json. If you never set it, then it will be “channels_last”.

dilation_rateint or tuple of int or list of int, optional

An integer or tuple/list of two integers, specifying the dilation rates to use for dilated convolution. Currently, specifying any dilation_rate value != 1 is incompatible with specifying any strides value != 1. Default is 1.

activationcallable() or str, optional

Activation function to use. Default is no activation (ie. “linear” activation: a(x) = x).

use_biasbool

Whether the layer uses a bias.

kernel_initializerInitializer or str, optional

Initializer for the convolution kernel. Default is “glorot_uniform” initialization.

bias_initializerInitializer or str, optional

Initializer for the bias vector. Default is None.

kernel_regularizerRegularizer or str, optional

Regularizer function applied to the convolution kernel. Default is None.

bias_regularizerRegularizer or str, optional

Regularizer function applied to the bias vector. Default is None.

activity_regularizerRegularizer or str, optional

Regularizer function applied to the output of the layer. Default is None.

kernel_constraint: Constraint or string, optional

Constraint function applied to the convolution kernel. Default is None.

bias_constraint: Constraint or string, optional

Constraint function applied to the bias vector. Default is None.

Notes

Input shape

4D tensor with shape (samples, channels, height, width) if data_format is “channels_first” or shape (samples, height, width, channels) if data_format is “channels_last”.

Output shape

4D tensor with shape (samples, filters, new_height, new_width) if data_format is “channels_first” or shape (samples, new_height, new_width, filters) if data_format is “channels_last”. new_height and new_width values might be different from height and width due to padding.