Closed cdoersch closed 8 years ago
While you're at it, why not add support for phase, level and stages? https://github.com/BVLC/caffe/pull/3863 https://github.com/BVLC/caffe/pull/4174
Sounds like this would make the PR more complicated, although I don't think I would actually need to rely on #3863 or #4174 to make it work. draw_net worked directly with the protocol buffer that defines the net structure, not with a caffe net. I'm not familiar with levels and stages. Would the interface just take in two extra parameters--stage and level--and if they're defined, do a simple equality test for any layers that have either of those two parameters defined? Or is there more complexity in determining whether a layer is included in the net?
Yeah it's not simple. See the functions I added in #4174 to mirror StateMeetsRule.
Honestly, I wouldn't worry about it for your PR. The @BVLC guys don't seem particularly eager to merge #3863, so I can't imagine they'd care about other netstate options for your "draw net" PR.
Fixed in #4408.
For some networks, especially Variational Autoencoders, there can be significant differences between the training-time network and the testing-time network. Hence, I propose that we add a "phase" flag to caffe.draw.draw_net which, if specified by the user, makes the function ignore any layers that belong to the wrong phase. This would make the drawn network much more understandable. My guess is that this change would only require about a dozen lines of code.
If the Caffe devs agree, I can write a PR. I'd appreciate a quick response since I'd like to include this with my tutorial on variational autoencoders.