pool - Definitions for all Pooling functions.¶
The file yann.core.pool.py contains the definition for all the Pooling
functions available.
Todo
- Need to support max_rand_pool and rand_pool
-
class
yann.core.pool.pooler_2d(input, ds, img_shp, mode='max', ignore_border=True, verbose=1)[source]¶ function that performs pooling
Parameters: - input – This variable should either
thenao.tensor4(theano.matrixreshaped also works) variable or an output from a pervious layer which is atheano.tensor4convolved with atheano.shared. The input should be of shape(batchsize, channels, height, width). For those who have tried pylearn2 or such, this is called bc01 format. - img_shp – This variable should a tuple or an array:
[batchsize, channels, height, width] - ds – tuple of pool sizes for rows and columns.
(pool height, pool width) - mode –
{‘max’, ‘sum’, ‘mean’, ‘max_same_size’} Operation executed on each window. max and sum
- if
max_same_sizewe do maxpooling with output is the same size. - if
maxwe do do maxpooling with output being downsampled. Output size will be(batchsize, channels, height/ds[0], width/ds[1]). - if
meanwe do do meanpooling with output being downsampled. Output size will be(batchsize, channels, height/ds[0], width/ds[1]). - if
sumwe do do sum pooling with output being downsampled. Output size will be(batchsize, channels, height/ds[0], width/ds[1]).
- if
- ignore_border – (default is
False) Consider theano’s documentation. It is directly supplied to theano’s pool module.
- input – This variable should either