TensorflowJS:什么是参数过滤器?

时间:2019-04-01 11:20:42

标签: tensorflow

我正在学习TensorflowJS,并且正在研究CNN。 我正在关注this,在本教程中,您必须像这样设置第一层参数

  // In the first layer of out convolutional neural network we have 
  // to specify the input shape. Then we specify some paramaters for 
  // the convolution operation that takes place in this layer.
  model.add(tf.layers.conv2d({
    inputShape: [IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_CHANNELS],
    kernelSize: 5,
    filters: 8,
    strides: 1,
    activation: 'relu',
    kernelInitializer: 'varianceScaling'
  }));

filters. The number of filter windows of size kernelSize to apply to the input data. Here, we will apply 8 filters to the data.

尽管有一些小小的解释,我仍然不明白过滤器是什么:(有人可以解释一下我吗?

谢谢。

1 个答案:

答案 0 :(得分:0)

这不是正确的定义,但也许会帮助您直觉。过滤器就像渠道。如果您有28 x 28像素的图像,并且该图像具有RGB颜色,则可以说您的图片尺寸为28 x 28 x 3,其中3 = [红色,绿色,蓝色]。如果将过滤器设置为10(假设前两个人保持不变),则原始输入的尺寸将为28x28x10。这对于特征检测非常有用。但是计算非常昂贵。