Caffe 学习:Eltwise层

来源:互联网 发布:程序员月度工作总结 编辑:程序博客网 时间:2024/05/16 18:17
Eltwise层的操作有三个:product(点乘), sum(相加减) 和 max(取大值),其中sum是默认操作。

 

  假设输入(bottom)为A和B,如果要实现element_wise的A+B,即A和B的对应元素相加,prototxt文件如下:

复制代码
layer {  name: "eltwise_layer"  type: "Eltwise"  bottom: "A"  bottom: "B"  top: "diff"  eltwise_param {    operation: SUM  }}​
复制代码

 

  如果实现A-B,则prototxt为:

复制代码
layer {  name: "eltwise_layer"  type: "Eltwise"  bottom: "A"  bottom: "B"  top: "diff"  eltwise_param {    operation: SUM    coeff: 1    coeff: -1  }}​
复制代码

  其中A和B的系数(coefficient)都要给出!

0 0
原创粉丝点击