0
votes

I have designed a neural network using 2d convolutional layers and max-pooling layers with the input shape for input, one hot encoded sequences as 2d array. then it is reshaped before inputting the model.

data = np.zeros( (100, 21 * 1000), dtype=np.float32 )
#reshape
x_data = tf.reshape( data, [-1, 1, 1000, 21] )

However, I used the same dataset using 1D convolutional layers by changing the model and input array without reshaping as it is 1D data = np.zeros( (100, 1000,21), dtype=np.float32 )

finally, the 1D convolutional model performed well with 96% act. and 2d CNN gave 93%. Can someone explain to me what actually happens there to increase the accuracy?

1

1 Answers

0
votes

Can someone explain to me what actually happens there to increase the accuracy?

That's hard to tell and depends on your specific dataset, network, hyperparameters etc. Generally, in a conv2D-Layer the filter shifts horizontal and vertical. In a conv1D-Layer the filter shifts only vertical in the convolution process.

So which one is the best? That depends on your problem. For time series conv1D could be better and for images conv2D could be the better choice.