Skip to content

Caffe:Api:PoolingLayer

Pooling caffe layer class.

PoolingParameter

kernel_size (or kernel_h and kernel_w)
specifies height and width of each filter
pool [default MAX]
the pooling method. Currently MAX, AVE, or STOCHASTIC
pad (or pad_h and pad_w) [default 0]
specifies the number of pixels to (implicitly) add to each side of the input
stride (or stride_h and stride_w) [default 1]
specifies the intervals at which to apply the filters to the input
global_pooling [default false]
If global_pooling then it will pool over the size of the bottom by doing kernel_h = bottom->height and kernel_w = bottom->width

Protobuf example

layer {
  name: "pool1"
  type: "Pooling"
  bottom: "conv1"
  top: "pool1"
  pooling_param {
    pool: MAX
    kernel_size: 3 # pool over a 3x3 region
    stride: 2      # step two pixels (in the bottom blob) between pooling regions
  }
}

I/O

Input
n * c_i * h_i * w_i
Output
n * c_o * h_o * w_o
  • h_o = (h_i + 2 * pad_h - kernel_h) / stride_h + 1
  • w_o = (w_i + 2 * pad_w - kernel_w) / stride_w + 1

Max-pooling Graph

  • Original

10

20

30

40

  • Forward

40

Max-pooling Backpropagation

Pooling된 데이터의 Index를 기억하여 diff값을 전파한다. 위의 #Max-pooling Graph예제를 사용하면 아래와 같다.

0

0

0

diff

전파된 diff값은 다음 레이어에 그대로 전달된다.

Backpropagation reference

BackPropagation_MaxPool.png

See also

Favorite site