Global weighted Average Pooling

Hey Guys,

Could you guys let me know about how to implement Global weighted average pooling.

Thanks.

Hi @SerenityPersonified,

I just skimmed through the paper quickly, but it looks like you just need to perform elementwise multiplication (inputs multipled by learnt weights) followed by a sum across spatial dimensions. Is my understanding correct here?

If so, you should implement a Gluon Block which defines a weight parameter in __init__ method, and then use this in the forward method. I guess you’d want to softmax weight to get weights that sum to 1, and then multiply your inputs by these values. And finally sum across all spatial dimensions, returning the output. See this tutorial on how to implement a custom block with learnable parameters.

Are there any particular parts of the paper you’re struggling to implement?

Hello @thomelane,

I’m using symbol for the implementation. I’m not sure how to implement in it.
I want add Global weighted Average Pooling layer after the mxnet.symbol.contrib.PSROIPooling layer.

Thank you.