Skip to content

Conversation

@jeffdonahue
Copy link
Contributor

This PR is purely for refactoring; it's not intended to change any behavior whatsoever. It makes the Net::Init method 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 like layer_id or bottom_id, and (2) factoring out some of Init into separate methods AppendBottom and AppendTop. AppendBottom is called once for each bottom blob, AppendTop is 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.

@sguada
Copy link
Contributor

sguada commented Jun 12, 2014

@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_?

@jeffdonahue
Copy link
Contributor Author

Input blobs were already being added to blob_names_. I didn't change anything about output blobs as far as I know.

@shelhamer
Copy link
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
@shelhamer shelhamer merged commit 6b6ab33 into BVLC:dev Jun 13, 2014
@jeffdonahue jeffdonahue deleted the refactor-net branch June 13, 2014 20:32
mitmul pushed a commit to mitmul/caffe that referenced this pull request Sep 30, 2014
Minor Net::Init refactoring: name loop indices, add helpers
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.

3 participants