【问题标题】:Is there any layer for nearest-neighbor subsampling label image in caffe? [closed]caffe 中是否有任何层用于最近邻子采样标签图像? [关闭]
【发布时间】:2017-08-28 09:02:15
【问题描述】:

我想对网络中的标签图像进行二次采样,并且我希望该层的输出值都存在于输入标签图像中(即最近邻二次采样,而双线性二次采样则不存在)。 caffe中如何实现这样的一层?或者我在哪里可以找到现有开源代码中这一层的代码? 据我所知,deeplab代码中的interp层可以实现双线性二次采样,而二次采样的标签图像包含非法标签。

【问题讨论】:

    标签: deep-learning caffe conv-neural-network


    【解决方案1】:

    如果您只是在整数间隔对标签图像进行二次采样后,您可以使用卷积层的stride

    layer {
      name: "sub-sample"
      type: "Convolution"
      bottom: "label"
      top: "sub-sample"
      param { lr_mult: 0 decay_mult: 0 }  # do not learn this layer
      convolution_param {
        kernel_size: 1
        pad: 0
        stride: 2  # sub sample by 2
        bias_term: false  # no need for bias
        weight_filler { type: "constant" value: 1 }  
        num_output: 1  # make it the SAME as input number of channels
        group: 1       # same as num_output
      }
    }
    

    【讨论】:

      【解决方案2】:

      pooling layer 怎么样?您有 Max 和 Stochastic 池化方法,没有最近邻,但它适合您的输出值出现在原始输入中的需要。

      【讨论】:

      • 请不要回答离题的问题。这可以防止它们被自动删除。
      • @BDL 为什么跑题了?这是个好问题。
      • "在哪里可以找到代码?"恕我直言,要求提供场外资源。
      • @DBL 我同意措辞不是最佳的,但这不是一般的“给我代码”问题,而是“caffe 的什么功能我可以用来做X-Y-Z”。考虑到 caffe 文档的糟糕状态,这是一个合理的问题,恕我直言。
      猜你喜欢
      • 2012-10-23
      • 2010-09-06
      • 1970-01-01
      • 2014-01-07
      • 2011-06-20
      • 2017-06-11
      • 1970-01-01
      • 2011-12-06
      • 2014-03-13
      相关资源
      最近更新 更多