caffe |如何计算多个输入blob的元素加权和?

时间:2017-02-27 03:06:21

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

我有多个具有相同输出形状的卷积层 如何计算这些层的元素加权和? caffe中的输出?

1 个答案:

答案 0 :(得分:2)

对于按元素操作,请使用"Eltwise"图层。要获得“加权和”,您可以使用coeff参数:

layer {
  name: "wsum"
  type: "Eltwise"
  bottom: "x1"
  bottom: "x2"
  bottom: "x3"
  top: "y"
  eltwise_param {
    operation: SUM
    coeff: 0.5 # weight for x1 
    coeff: 0.3 # weight for x2
    coeff: 0.2 # weight for x3
  }
}

请注意,'coeff'参数仅适用于SUM操作。