XML-CNN
XML-CNN copied to clipboard
Pooling Method
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".
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