Allow the python layer have attribute "phase"#3995
Merged
longjon merged 2 commits intoBVLC:masterfrom May 4, 2016
Merged
Conversation
Contributor
|
Looks fine to me. Would you be able to add a test that demonstrates reading out the phase with TRAIN/TEST values as well? |
Member
|
related to issue #3506 -- thanks for implementing this PR! |
Contributor
|
Looks great to me. Can you squash the commits? @longjon , @shelhamer does this look good to you? |
| pass | ||
|
|
||
| def reshape(self, bootom, top): | ||
| top[0].reshape(1) |
Contributor
There was a problem hiding this comment.
Scalars should be 0d; use top[0].reshape().
Contributor
|
I never really got much into phase myself, but this is a clear improvement for the completeness of Python layers, so it seems worthwhile. However, there are a few style issues, as noted. I'd be happy to merge once these are fixed (and squashed into the existing two commits). |
Contributor
Author
|
@longjon Thanks for review and I've fixed it. I'm glad this pr is helpful. |
Contributor
|
Looks very clean now, thanks! |
fxbit
pushed a commit
to Yodigram/caffe
that referenced
this pull request
Sep 1, 2016
Allow the python layer have attribute "phase"
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.
I noticed that the python layer cannot tell whether the phase is TRAIN or TEST. This change may bring convenience in some cases. e.g. to me.