Search code examples
machine-learningcomputer-visiondeep-learningcaffereduction

Caffe - How to use reduction layer?


I have a question regarding the reduction layer in caffe. I haven't found any examples on how to use this layer in my .prototxt file. So I would appreciate it, if anybody could give me a short example of how to use this layer.

This is the documentation: http://caffe.berkeleyvision.org/doxygen/classcaffe_1_1ReductionLayer.html , but there is no example given :-/

I want to use this layer to reduce an output matrix of 1x18x18 to one scalar value. So i want the absolute sum of this matrix.


Solution

  • Try:

    layer {
      name: "reduction"
      type: "Reduction"
      bottom: "in"
      top: "out"
      reduction_param {
        axis: 0 # reduce all dims after first
        operation: ASUM  # use absolute sum
      }
    }
    

    For more information, see caffe.proto and the new caffe.help.