简体   繁体   中英

How can I overcome that my output shape decreases as I keep on Maxpooling per layer?

I am building a 1D Convolutional Neural Network (CNN). From many sources I have understood that performance of the CNN increases if more layers are added. However, at each pooling layer, my output shape is 50% smaller than my input (because I use a pool size of 2). This means that I cant add more layers, once my output has shape 1.

Are there ways to overcome this 'decreasing shape problem' or is it just a matter of increasing my input shape?

I am building a 1D Convolutional Neural Network (CNN). From many sources I have understood that performance of the CNN increases if more layers are added.

This is not always true. It usually depends on the data you have and the task that you are trying to resolve.

Quoting https://www.quora.com/Why-do-we-use-pooling-layer-in-convolutional-neural-networks

Pooling allows features to shift relative to each other resulting in robust matching of features even in the presence of small distortions. There are also many other benefits of doing pooling, like: Reduces the spatial dimension of the feature map. And hence also reducing the number of parameters high up the processing hierarchy. This simplifies the overall model complexity.

Then depending on the stride, pooling size and padding, you might voluntarily reduce your output shape.

Going back to your question, if you don't want your shape to be decreasing, consider to use strides=1 and padding='same'.

(see https://keras.io/layers/pooling )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM