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

BatchReindexLayer to shuffle, subsample, and replicate examples in a batch #2966

Merged
merged 1 commit into from
Oct 14, 2015

Conversation

cdoersch
Copy link
Contributor

This layer takes two blobs as input and uses the second blob to index the first blob along the first axis.

This layer is needed for the training procedure described in this paper, which first samples patches and extracts fc6-like features, before shuffling them around and pairing them up halfway through the network. @shelhamer agrees that this may be useful to others, hence this PR. It has documentation in comments and tests; this should be ready for review.

@jeffdonahue
Copy link
Contributor

Thanks @cdoersch, this mostly looks good. For merge the main issues I see are related to the use of legacy 4D blob indexing in this layer (which is not specific to images). Specifically:

  • uses of num() should be removed (change to shape(0))
  • the shapes in the docs should be updated (e.g., first blob should be (N \times ...) and second blob should be 1D (N)(M))
  • check should be added that the second blob is 1D (CHECK_EQ(1, bottom[1]->num_axes())) and the dimension of its only axis equals the dimension of the first axis of bottom[0] (again using bottom[0]->shape(0)) edit: sorry, I misinterpreted the layer's behavior with this last suggestion.

@cdoersch cdoersch force-pushed the batch_reindex_layer branch 3 times, most recently from 6f8b85e to 4367d98 Compare October 7, 2015 15:03
@jeffdonahue
Copy link
Contributor

Thanks for the cleanup @cdoersch, LGTM.

jeffdonahue added a commit that referenced this pull request Oct 14, 2015
BatchReindexLayer to shuffle, subsample, and replicate examples in a batch
@jeffdonahue jeffdonahue merged commit 8c8e832 into BVLC:master Oct 14, 2015
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.

2 participants