eltwise sum over multiple channels

3,031 views
Skip to first unread message

Moti Agrawal

unread,
Nov 16, 2014, 6:25:49 PM11/16/14
to caffe...@googlegroups.com, agr...@ai.sri.com
Does anybody know if eltwise sum is define over multiple channels.
In other words if my bottom layer has 16 channels. Can i do eltwise sum in effect summing all 16 channels

//produces 16 channels
layers {
  name: "conv_1"
  type: CONVOLUTION
  blobs_lr: 1.
  blobs_lr: 2.
  convolution_param {
    num_output: 16
    kernelsize: 1
    stride: 1
    weight_filler {
      type: "xavier"
    }
    bias_filler {
      type: "constant"
    }
  }
  bottom: "data_1"
  top: "conv_1"
}


//sum over 16 channels
layers {
  name: "sum_1"
  type: ELTWISE
  bottom: "conv_1"
  top: "sum_1"
  eltwise_param {
    op: SUM
    coeff: 1
  }
}

lei zou

unread,
Mar 17, 2015, 11:17:18 PM3/17/15
to caffe...@googlegroups.com, agr...@ai.sri.com
hi, i wondered the answer too. have you got the right answer? best wishes!

在 2014年11月17日星期一 UTC+8上午7:25:49,Moti Agrawal写道:

Beanfrog Green

unread,
Mar 28, 2015, 5:52:13 AM3/28/15
to caffe...@googlegroups.com, agr...@ai.sri.com
Maybe you can try SLICE the blobs to 16 blobs across the channels, then use ELTWISE SUM to sum the 16 blobs


在 2014年11月17日星期一 UTC+8上午7:25:49,Moti Agrawal写道:
Does anybody know if eltwise sum is define over multiple channels.

Beanfrog Green

unread,
Mar 30, 2015, 3:39:44 AM3/30/15
to caffe...@googlegroups.com, agr...@ai.sri.com
Again, see https://groups.google.com/d/msg/caffe-users/M5japI--dAw/3G-Jc8WafzgJ
we can use 1x1 conv to do sum cross maps, here is a example:


//sum over 16 channels
layers {
  name: "sum_1"
  type: CONVOLUTION
  bottom: "conv_1"
  top: "sum_1"
  blobs_lr: 0
  convolution_param {
    num_output: 1
    bias_term: false
    kernel_size: 1
    weight_filler {
      type: 'constant'
      value: 1

    }
  }
}




在 2014年11月17日星期一 UTC+8上午7:25:49,Moti Agrawal写道:
Does anybody know if eltwise sum is define over multiple channels.

Teddy Ma

unread,
Apr 27, 2016, 11:17:17 PM4/27/16
to Caffe Users, agr...@ai.sri.com
It's really a good idea,thx a lot!

在 2015年3月30日星期一 UTC+8下午3:39:44,Beanfrog Green写道:
Reply all
Reply to author
Forward
0 new messages