Conversation
Contributor
|
@jeffdonahue it looks good to me, but you changed another thing that you didn't mention in the description. Did you add the input and output blobs to blob_names_? |
Contributor
Author
|
Input blobs were already being added to |
Member
|
Thanks Jeff -- I agree the named loop indices and helpers raise the clarity. |
shelhamer
added a commit
that referenced
this pull request
Jun 13, 2014
Minor Net::Init refactoring: name loop indices, add helpers
mitmul
pushed a commit
to mitmul/caffe
that referenced
this pull request
Sep 30, 2014
Minor Net::Init refactoring: name loop indices, add helpers
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.
This PR is purely for refactoring; it's not intended to change any behavior whatsoever. It makes the
Net::Initmethod a bit more readable (imo) by (1) changing the single-character loop index var names (which I use constantly, no offense intended) to more meaningful ones likelayer_idorbottom_id, and (2) factoring out some ofInitinto separate methodsAppendBottomandAppendTop.AppendBottomis called once for each bottom blob,AppendTopis called once for each top blob or input blob (merging the common setup between inputs and normal top blobs).I will follow up with other PRs built on top this one, but I'm PRing this first to make it easier to see what has actually changed with those further PRs in terms of behavior, vs. just changes due to refactoring. Feel free to ignore this PR until those followups appear.