BVLC/caffe — pull request #199 by longjon (2014-03-11 05:33:45+00:00)
Title: Update Python interface, using OrderedDict for blobs and layers

This commit modifies the pycaffe interface to use OrderedDict in place of lists for blobs and layers, per the discussion in #112. Some notes:
* There are four ways this could have been accomplished:
1. return an OrderedDict using boost::python
2. in separate Python code, write a wrapper class with the boost interface as member
3. in separate Python code, write a wrapper extending the boost interface through inheritance
4. in separate Python code, directly update the class exposed through boost

This PR uses the third method. The first is a headache, and it may be useful to add more pure-Python functionality anyway. The second requires explicit wrappers for every method exposed via boost. The fourth makes the code a little less obvious and more mind-bending.

* `caffe.CaffeNet` was renamed `caffe.Net`
* `Net.blobs` was made an OrderedDict
* Layers are now exposed as an OrderedDict (which really just provides groups of parameter blobs). Note that layer parameter blobs don't have names in caffe proper, only layers have names, so `Net.params` was kept as a list, as it is in C++.
* This code should probably be updated to use #161 if/when that is merged.