Calculate the average of a drop of data during the testing phase

I am using an hdf5 layer which has data and labels.

layer {
  name: "data"
  type: "HDF5Data"
  top: "data"
  top: "label"
  include {
    phase: TEST
  }
  hdf5_data_param {
    source: "./list.txt"
    batch_size: 8
    shuffle: true
  }
}

      

During the testing phase, it will download 8 images from the test suite and feed the network. I would like to print the average of each image during the testing phase. Can I use it in CAFFE? Which layer should I use?

+3


source to share


1 answer


I think you are looking for "Reduction"

layer



layer {
  type: "Reduction"
  name: "img_mean"
  bottom: "data"
  top: "img_mean"
  reduction_param {
    operation: MEAN
    axis: 0  # to reduce the entire batch, or axis: 1 for per-image mean
  }
}

      

+2


source







All Articles