Support arbitrary DAGs with SplitLayer#114
Conversation
|
Would be possible to reuse the blobs as in dropout or relu layers? |
|
Good point Sergio; you can make the 0th top blob in-place by giving it the same name as the bottom blob, but the remaining top blobs can't be done in-place as they need their own diffs (at least, I think..). Implemented this behavior in the commits since your comment. |
|
It looks very good Jeff, I'll look into more detail tomorrow. Sergio
|
|
Good suggestion -- added such a test (TestInsertionTwoTop) |
|
Looks good to me! @Yangqing? |
|
Looks great to me :) |
|
Merged! We all like DAGs, don't we? |
Support arbitrary DAGs with SplitLayer
|
I found a bug. As the regularizer and l1 norm layer are both using conv1, a split layer is inserted. This layer gives conv1 as one of its outputs in-place and thus the network has two layers (relu) and conv1_split both generating conv1 blob. |
|
@aravindhm E0217 16:48:43.778092 7087 test_net.cpp:28] Using GPU |
|
Thanks for the report, this actually breaks any architecture that uses in-place computation, sorry about that :( I'm working on a fix and Evan is going to roll back the change in the meantime. |
|
Thanks, Jeff! The "arbitrary split" thing is a great idea... I bet you'll be able to work out the kinks. :) Let me know when we've rolled back to something stable? |
Revert dags-by-split merge because split layers were not quite ready. Sorry for the bug! We are adopting a `master`/`dev` split development model, where new commits and pull requests will be merged to `dev` for testing before integration to `master`. This will keep master clean and stable. This reverts commit d339d24, reversing changes made to 5519826.
|
Fixed by revert at dda8978. Sorry for the breakage! We're adopting a split development model of Split layers will be merged into |
|
@jeffdonahue @Yangqing |
|
The order is indeed relevant -- anytime a bottom is named, that name must have been defined previously as a top (so "no" is the answer to your second question). I considered not requiring this (i.e. allowing non-topological orderings in the prototxt), but decided against it given the added complexity and the fact that it doesn't actually add any extra power (given that a DAG always has a topological ordering). And given that it doesn't add power, one could argue that it's only a hazardous feature, as requiring a topological ordering makes it more likely we'll catch bugs in the net definition not matching the user's intent, and makes the meaning of the net definition clearer to probably any human reader (unless there are weird cases I'm not considering). I think it'd be strictly better if there were some sort of error message actually indicating the problem in the non-topological ordering case (e.g. crashing with the message It'd arguably be better (adding flexibility, but also perhaps adding more potential for bugs) to just allow non-topological orderings. I don't really have that much of a preference either way. |
Support arbitrary DAGs with SplitLayer
Revert dags-by-split merge because split layers were not quite ready. Sorry for the bug! We are adopting a `master`/`dev` split development model, where new commits and pull requests will be merged to `dev` for testing before integration to `master`. This will keep master clean and stable. This reverts commit d339d24, reversing changes made to 5519826.
Promote caffe-0.14 branch to master
Addresses #92 as per Yangqing's suggested implementation using SplitLayers. Basically, this allows any blob to be used as "bottom"s multiple times in a network definition.
My opinion is that in the long run it would be better to do this in a less wasteful manner by changing the specification of Backward(...) to add to the current _diff, but this wasteful implementation is better than simply not supporting a blob shared as input by multiple layers.