Conversation
536cbc6 to
8995235
Compare
myfavouritekk
added a commit
to myfavouritekk/caffe
that referenced
this pull request
Mar 16, 2015
ReductionLayer * jeffdonahue/reduction-layer: Add ReductionLayer to reduce any number of "tail" axes to a scalar value Conflicts: src/caffe/proto/caffe.proto
src/caffe/layers/reduction_layer.cpp
Outdated
Member
There was a problem hiding this comment.
SUM_OF_SQUARES is a little unlike the other op names. SUMSQ fits in with ASUM. Your pick.
Contributor
Author
There was a problem hiding this comment.
fair enough -- I'll change it to SUMSQ
Member
|
Once the comments are addressed this looks fine, although there could be a test for reducing over a tail that isn't all dimensions. p.s. N-D blobs are nice. |
8995235 to
96ac452
Compare
Contributor
Author
|
Thanks for all the reviews @shelhamer! Tests for non-zero axis added; will merge after Travis. |
5228452 to
823d055
Compare
Currently implements operations SUM, MEAN, ASUM (sum of absolute values), and SUMSQ (sum of squares)
Contributor
Author
|
Wow... especially thanks for the suggestion to test other axes. I had a bug in Backward for |
Member
|
Tests are more trustworthy than me. Good catch! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Performs a "reduction" operation (currently
SUM,MEAN,ASUMfor sum of absolute values, andSUMSQfor sum of squares) to turn a number of "tail" axes into a single scalar value. TheMEANoperation, in combination with aloss_weight, is useful for creating custom losses that don't have an obnoxious amount of output. For example, thisEuclideanLoss:...is equivalent to this
Reduction:(would be more efficient to do as a single
ReductionwithSUM_OF_SQUARESand a certaincoeffsetting, but then you have to compute the batch size and everything is less pretty...)Eventually, this should support reduction along inner axes (e.g. support an
end_axis), but that makes the implementation substantially more involved than this...