Skip to content

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.

@cdoersch cdoersch force-pushed the batch_reindex_layer branch from 18494b7 to 29da58f Compare August 24, 2015 15:41
@cdoersch cdoersch closed this Aug 24, 2015
@cdoersch cdoersch reopened this Aug 24, 2015
@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
@cdoersch cdoersch force-pushed the batch_reindex_layer branch from 4367d98 to bda1a63 Compare October 8, 2015 01:41
@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