caffe之(二)pooling層


在caffe中,網絡的結構由prototxt文件中給出,由一些列的Layer(層)組成,常用的層如:數據加載層、卷積操作層、pooling層、非線性變換層、內積運算層、歸一化層、損失計算層等;本篇主要介紹pooling層

1. Pooling層總述

下面首先給出pooling層的結構設置的一個小例子(定義在.prototxt文件中) 

layer {
  name: "pool1"   //該層的名稱
  type: "Pooling"  //該層的類型
  bottom: "norm1"  //該層的輸入數據blob
  top: "pool1"   //該層的輸出數據blob

  // 該層的相關參數設置
  pooling_param {
    pool: MAX  //pooling類型,默認值為MAX,也可以設置為AVE,STOCHASTIC
    kernel_size: 3  //pooling核大小,為必設參數
    stride: 2  //pooling核步長,默認值為1(即重疊),但通常設置為2;
  }

}

 

注:在caffe的原始proto文件中,關於卷積層的參數PoolingParameter定義如下:

message PoolingParameter {
  enum PoolMethod {
    MAX = 0;
    AVE = 1;
    STOCHASTIC = 2;
  }
  optional PoolMethod pool = 1 [default = MAX]; // The pooling method
  // Pad, kernel size, and stride are all given as a single value for equal
  // dimensions in height and width or as Y, X pairs.
  optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X)
  optional uint32 pad_h = 9 [default = 0]; // The padding height
  optional uint32 pad_w = 10 [default = 0]; // The padding width
  optional uint32 kernel_size = 2; // The kernel size (square)
  optional uint32 kernel_h = 5; // The kernel height
  optional uint32 kernel_w = 6; // The kernel width
  optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X)
  optional uint32 stride_h = 7; // The stride height
  optional uint32 stride_w = 8; // The stride width
  enum Engine {
    DEFAULT = 0;
    CAFFE = 1;
    CUDNN = 2;
  }
  optional Engine engine = 11 [default = DEFAULT];
  // If global_pooling then it will pool over the size of the bottom by doing
  // kernel_h = bottom->height and kernel_w = bottom->width
  optional bool global_pooling = 12 [default = false];
}

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM