Skip to content

A Global Average Pooling Function? #2617

Answered by cgarciae
codymlewis asked this question in Ideas
Discussion options

You must be logged in to vote

Hey @codymlewis, global average pooling is just mean over the spatial/temporal dims e.g:

x = jnp.mean(x, axis=(1, 2)) # assuming (batch, height, width, channels)

I don't see a real benefit of adding a GobalAveragePooling Module, currently nn.max_pool and nn.avg_pool are just functions so it would make sense for this operation to also be a function, jnp.mean is already that function so there would need to be some additional motivation to create a dedicated wrapper.

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
4 replies
@codymlewis
Comment options

@marcvanzee
Comment options

@cgarciae
Comment options

@codymlewis
Comment options

Answer selected by codymlewis
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Ideas
Labels
None yet
3 participants