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

Merged
merged 1 commit into from Oct 14, 2015

Conversation

Projects
None yet
2 participants
Contributor

cdoersch commented Aug 24, 2015

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.

cdoersch closed this Aug 24, 2015

cdoersch reopened this Aug 24, 2015

Contributor

jeffdonahue commented Oct 5, 2015

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.
Contributor

jeffdonahue commented Oct 14, 2015

Thanks for the cleanup @cdoersch, LGTM.

@jeffdonahue jeffdonahue added a commit that referenced this pull request Oct 14, 2015

@jeffdonahue jeffdonahue Merge pull request #2966 from cdoersch/batch_reindex_layer
BatchReindexLayer to shuffle, subsample, and replicate examples in a batch
8c8e832

@jeffdonahue jeffdonahue merged commit 8c8e832 into BVLC:master Oct 14, 2015

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment