XML-CNN icon indicating copy to clipboard operation
XML-CNN copied to clipboard

Pooling Method

Open fikrimohammad opened this issue 5 years ago • 1 comments

Hi siddsax,

I wanna ask about the pooling layer because you're using a sliding max pooling. XML-CNN use dynamic max pooling with the definition "For a p document with m words, we evenly divide its m-dimensional feature map into p chunks, each chunk is pooled to a single feature by taking the largest value within that chunk".

fikrimohammad avatar May 09 '19 21:05 fikrimohammad

I think it should be the same as Avg pooling.

l_pool = nn.MaxPool1d(pool_size, stride=None, count_include_pad=True)

the pooling_units parameter corresponds to the parameter p in the paper. So it's a direct translation (ignoring the padding part)

pool_size = l_out_size // params.pooling_units

YipingNUS avatar Aug 20 '20 07:08 YipingNUS