summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorEvan Shelhamer <shelhamer@imaginarynumber.net>2014-04-09 14:02:40 -0700
committerEvan Shelhamer <shelhamer@imaginarynumber.net>2014-05-13 18:10:41 -0700
commit51f276e6b20f18c41079fab01177988491825536 (patch)
tree6ed7b884e650b467a255960e9f31434564ecc82c /python
parent7b3e6f2341fe7374243ee0126f5cad1fa1e44e14 (diff)
downloadcaffe-51f276e6b20f18c41079fab01177988491825536.tar.gz
caffe-51f276e6b20f18c41079fab01177988491825536.tar.bz2
caffe-51f276e6b20f18c41079fab01177988491825536.zip
match existing python formatting
Diffstat (limited to 'python')
-rw-r--r--python/caffe/pycaffe.py37
1 files changed, 21 insertions, 16 deletions
diff --git a/python/caffe/pycaffe.py b/python/caffe/pycaffe.py
index 05187e98..6b7b00e0 100644
--- a/python/caffe/pycaffe.py
+++ b/python/caffe/pycaffe.py
@@ -14,30 +14,35 @@ from ._caffe import Net, SGDSolver
@property
def _Net_blobs(self):
- """
- An OrderedDict (bottom to top, i.e., input to output) of network
- blobs indexed by name
- """
- return OrderedDict([(bl.name, bl) for bl in self._blobs])
+ """
+ An OrderedDict (bottom to top, i.e., input to output) of network
+ blobs indexed by name
+ """
+ return OrderedDict([(bl.name, bl) for bl in self._blobs])
Net.blobs = _Net_blobs
+
@property
def _Net_params(self):
- """
- An OrderedDict (bottom to top, i.e., input to output) of network
- parameters indexed by name; each is a list of multiple blobs (e.g.,
- weights and biases)
- """
- return OrderedDict([(lr.name, lr.blobs) for lr in self.layers
- if len(lr.blobs) > 0])
+ """
+ An OrderedDict (bottom to top, i.e., input to output) of network
+ parameters indexed by name; each is a list of multiple blobs (e.g.,
+ weights and biases)
+ """
+ return OrderedDict([(lr.name, lr.blobs) for lr in self.layers
+ if len(lr.blobs) > 0])
Net.params = _Net_params
def _Net_set_input_arrays(self, data, labels):
- if labels.ndim == 1:
- labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
- np.newaxis])
- return self._set_input_arrays(data, labels)
+ """
+ Set input arrays of the in-memory MemoryDataLayer.
+ (Note: this is only for networks declared with the memory data layer.)
+ """
+ if labels.ndim == 1:
+ labels = np.ascontiguousarray(labels[:, np.newaxis, np.newaxis,
+ np.newaxis])
+ return self._set_input_arrays(data, labels)
Net.set_input_arrays = _Net_set_input_arrays