Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Allow for pooling over the first blob axis based on a key #3732

Closed
wants to merge 10 commits into from

Conversation

elezar
Copy link
Contributor

@elezar elezar commented Feb 26, 2016

Internally, we have found that treating images as a collection and pooling over them results in improved performance for some tasks.

In an attempt to generalize this, I have started work on a key-based pooling layer. The idea is that in addition to the bottom blob representing the input data, a second blob is provided that indicates the keys associated with each of the entries in the batch (first dimension). An additional pooling step is then used to pool over all images withe the same key.

This can be seen as something similar to a reduce-by-key operation.

Although I am implementing this as an additional layer (which has a pooling layer member), there are some open questions which may indicate that it would be worth it to extend the pooling layer itself. As the initial proof of concept, I am performing the MAX pooling over the keys as a hard-coded step. Ideally, this should be handled by the pooling layer itself. Does it make sense to add further parameters to the pooling layer that handles these options? Is it feasible to pool over color channels, for example?

@elezar
Copy link
Contributor Author

elezar commented Feb 29, 2016

I have a minimal working (CPU) implementation for MAX pooling over keys. Any feedback would be appreciated.

I still need to improve the generality of the layer with regards to other pooling parameters, but before then I have some questions with regards to MAX pooling. Here, the indices of the maximum elements are returned in a second top blob (or stored internally). One thing that is a bit problematic with regards to this pull request is that index returned is always per-channel. Does it not make sense to change this so that the indices are always global (w.r.t. a batch)? I would assume that this is required for Nd pooling, and also seems to be in keeping with other pooling implementations (such as https://www.tensorflow.org/versions/r0.7/api_docs/python/nn.html#max_pool_with_argmax). For the time being, I am able to work around this by adjusting the indices manually, after calling the internal pooling layer, but this really is not ideal.

@elezar elezar mentioned this pull request Mar 1, 2016
@elezar
Copy link
Contributor Author

elezar commented Oct 18, 2016

Closing pull request due to lack of interest/time.

@elezar elezar closed this Oct 18, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant