首页 > 解决方案 > TensorflowJS:什么是参数过滤器?

问题描述

我正在学习 TensorflowJS,我正在研究 CNN。我正在关注这个,在本教程中你必须像这样参数化第一层

  // 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.

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

谢谢你。

标签: tensorflow

解决方案


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


推荐阅读