【发布时间】:2017-09-30 14:48:04
【问题描述】:
我对 keras 的 conv1d 层中的这两个参数感到非常困惑: https://keras.io/layers/convolutional/#conv1d
文档说:
filters: Integer, the dimensionality of the output space (i.e. the number output of filters in the convolution).
kernel_size: An integer or tuple/list of a single integer, specifying the length of the 1D convolution window.
但这似乎与我在许多教程中看到的标准术语无关,例如 https://adeshpande3.github.io/adeshpande3.github.io/A-Beginner's-Guide-To-Understanding-Convolutional-Neural-Networks/ 和 https://machinelearningmastery.com/sequence-classification-lstm-recurrent-neural-networks-python-keras/
使用使用 Keras 的第二个教程链接,我想实际上“kernel_size”与定义输入特征空间上的滑动窗口的传统“过滤器”概念相关。但是 conv1d 中的 'filter' 参数呢?它有什么作用?
例如在下面的代码sn-p中:
model.add(embedding_layer)
model.add(Dropout(0.2))
model.add(Conv1D(filters=100, kernel_size=4, padding='same', activation='relu'))
假设嵌入层输出一个维度为 50(行,每行是一个句子中的一个词)x 300(列,词向量维度)的矩阵,那么 conv1d 层如何转换该矩阵?
非常感谢
【问题讨论】:
标签: keras convolution