A Python script for at-a-glance net summary #3090
Merged
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.
So you've got complicated nets, perhaps generated by pycaffe's net spec, resulting in lengthy and intricate prototxt files. You code carefully, but sometimes you make mistakes... mistakes that result in training the wrong net, mistakes that just weren't obvious from the pages of Python, the rapidly scrolling log files, the endlessly verbose prototxt, the loss that's still kinda falling, the results that are just mediocre...
The aim of this tool is to provide a concise but comprehensive listing of the computation as Caffe sees it, so that you can tell at-a-glance, among other things:
Here's some example output, for "CaffeNet"'s
deploy.prototxt
:Now for
train_val.prototxt
, showing LR and decay multipliers:And the example for which I wrote this, showing finetuning of certain layers, Python layers, and loss weight:
The actual output uses ANSI color codes, making connectivity more obvious, and pointing out which bottoms and tops are disconnected, e.g., for CaffeNet

train_val
:The colors were picked to stand out for a deuteranomalous person using a white-on-black terminal (i.e., me); they might not work for you and aren't very aesthetic (patches welcome!). (Of course, seeing the actual graph would be more ideal, but that's also more challenging to display concisely and clearly or on a terminal.)
This is a first take. Many things that would be nice to display aren't displayed (e.g., note lack of phase information above). I'll probably dogfood this along a bit (but no promises!), feedback and patches are welcome.