当我保持每层最大池时,如何克服输出形状减小的问题?

2024-04-20 08:40:00 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在建立一个一维卷积神经网络(CNN)。从许多来源我了解到,如果增加更多的层,CNN的性能会提高。但是,在每个池层,我的输出形状比我的输入小50%(因为我使用的池大小是2)。这意味着我不能添加更多的层,一旦我的输出有形状1。在

有什么方法可以克服这种“形状变小的问题”还是仅仅是增加输入形状的问题?在


Tags: 方法来源神经网络性能卷积cnn形状池层
1条回答
网友
1楼 · 发布于 2024-04-20 08:40:00

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.

这并不总是真的。它通常取决于您拥有的数据和您试图解决的任务。在

引用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.

然后,根据步幅、池大小和填充,您可能会自愿减少输出形状。在

回到你的问题,如果你不想你的形状变小,考虑使用跨步=1和padding='same'。在

(见https://keras.io/layers/pooling

相关问题 更多 >