.def("copy_from", static_cast<void (Net<Dtype>::*)(const string)>(
&Net<Dtype>::CopyTrainedLayersFrom))
.def("share_with", &Net<Dtype>::ShareTrainedLayersWith)
+ .add_property("_blob_loss_weights", bp::make_function(
+ &Net<Dtype>::blob_loss_weights, bp::return_internal_reference<>()))
.add_property("_blobs", bp::make_function(&Net<Dtype>::blobs,
bp::return_internal_reference<>()))
.add_property("layers", bp::make_function(&Net<Dtype>::layers,
.def(bp::vector_indexing_suite<vector<string> >());
bp::class_<vector<int> >("IntVec")
.def(bp::vector_indexing_suite<vector<int> >());
+ bp::class_<vector<Dtype> >("DtypeVec")
+ .def(bp::vector_indexing_suite<vector<Dtype> >());
bp::class_<vector<shared_ptr<Net<Dtype> > > >("NetVec")
.def(bp::vector_indexing_suite<vector<shared_ptr<Net<Dtype> > >, true>());
bp::class_<vector<bool> >("BoolVec")
@property
+def _Net_blob_loss_weights(self):
+ """
+ An OrderedDict (bottom to top, i.e., input to output) of network
+ blob loss weights indexed by name
+ """
+ return OrderedDict(zip(self._blob_names, self._blob_loss_weights))
+
+
+@property
def _Net_params(self):
"""
An OrderedDict (bottom to top, i.e., input to output) of network
# Attach methods to Net.
Net.blobs = _Net_blobs
+Net.blob_loss_weights = _Net_blob_loss_weights
Net.params = _Net_params
Net.forward = _Net_forward
Net.backward = _Net_backward