3

我正在使用具有數據和標籤的hdf5圖層。在測試階段計算數據blob的平均值

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

在測試階段,它會從測試集中加載8個圖像並饋入網絡。我想在測試階段打印每幅圖像的平均值。是否有可能在CAFFE中使用它?我應該使用哪一層?

回答

2

我認爲你正在尋找"Reduction"

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 
    } 
} 
+1

感謝。這是正確的。但它有輕微的錯字。它必須是減少 – user8264