I came across multiple implementations of a CNN in Keras and noticed that some people use Conv1D from from keras.layers.convolutional import Conv1D and others use Convolution1D from from keras.layers import Convolution1D. Is there a difference or an advantage to either one or are they possibly simply just different versions of Keras.
1D convolution layer (e.g. temporal convolution). This layer creates a convolution kernel that is convolved with the layer input over a single spatial (or temporal) dimension to produce a tensor of outputs.
With Conv1D, one dimension only is used, so the convolution operates on the first axis (size 68 ). With Conv2D, two dimensions are used, so the convolution operates on the two axis defining the data (size (68,2) )
The convolutional layer learns local patterns of given data in convolutional neural networks. It helps to extract the features of input data to provide the output.
Conv1D input: output: (None,800,3) (None,201,4) The batch dimension is the number of samples in the dataset. It is denoted as None, as it is not fixed. Each input sample is a 3 channel window of size 800 steps. The output step value may change due to padding or strides.
They are just for different keras versions, before Keras 2.0 the layers were called ConvolutionalND for N = 1, 2, 3, and since Keras 2.0 they are just called ConvND.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With