proto update
authorYangqing Jia <jiayq84@gmail.com>
Tue, 24 Sep 2013 19:56:40 +0000 (12:56 -0700)
committerYangqing Jia <jiayq84@gmail.com>
Tue, 24 Sep 2013 19:58:13 +0000 (12:58 -0700)
.gitignore
src/caffe/blob.cpp
src/caffe/blob.hpp
src/caffe/proto/layer_param.proto
src/caffe/proto/layer_param_pb2.pyc [deleted file]

index ca27edc..14428f6 100644 (file)
@@ -3,6 +3,7 @@
 *.lo
 *.o
 *.cuo
+*.pyc
 
 # Compiled Dynamic libraries
 *.so
index d0e47da..fdd7036 100644 (file)
@@ -117,7 +117,7 @@ void Blob<Dtype>::FromProto(const BlobProto& proto) {
 }
 
 template <typename Dtype>
-void Blob<Dtype>::ToProto(BlobProto* proto) {
+void Blob<Dtype>::ToProto(BlobProto* proto, bool write_diff) {
   proto->set_num(num_);
   proto->set_channels(channels_);
   proto->set_height(height_);
@@ -128,9 +128,11 @@ void Blob<Dtype>::ToProto(BlobProto* proto) {
   for (int i = 0; i < count_; ++i) {
     proto->add_data(data_vec[i]);
   }
-  const Dtype* diff_vec = cpu_diff();
-  for (int i = 0; i < count_; ++i) {
-    proto->add_diff(diff_vec[i]);
+  if (write_diff) {
+    const Dtype* diff_vec = cpu_diff();
+    for (int i = 0; i < count_; ++i) {
+      proto->add_diff(diff_vec[i]);
+    }
   }
 }
 
index 35e6d2c..32a6566 100644 (file)
@@ -51,7 +51,7 @@ class Blob {
   Dtype* mutable_gpu_diff();
   void Update();
   void FromProto(const BlobProto& proto);
-  void ToProto(BlobProto* proto);
+  void ToProto(BlobProto* proto, bool write_diff = false);
 
  private:
   shared_ptr<SyncedMemory> data_;
index ddd1334..ff545ce 100644 (file)
@@ -11,6 +11,11 @@ message BlobProto {
   repeated float diff = 6 [packed=true];
 }
 
+message Datum {
+  optional BlobProto blob = 1;
+  optional int32 label = 2;
+}
+
 message FillerParameter {
   // The filler type. In default we will set it to Gaussian for easy
   // debugging.
@@ -57,4 +62,6 @@ message LayerConnection {
 message NetParameter {
   optional string name = 1; // consider giving the network a name
   repeated LayerConnection layers = 2; // a bunch of layers.
+  repeated string bottom = 3; // The input to the network
+  repeated string top = 4; // The output of the network.
 }
diff --git a/src/caffe/proto/layer_param_pb2.pyc b/src/caffe/proto/layer_param_pb2.pyc
deleted file mode 100644 (file)
index 6e6c693..0000000
Binary files a/src/caffe/proto/layer_param_pb2.pyc and /dev/null differ