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 ca27edc412e61b21d3b08b2e9ded4a51e45c505e..14428f6da9c9bc09e9cf8468ac589b7c9809c6c9 100644 (file)
@@ -3,6 +3,7 @@
 *.lo
 *.o
 *.cuo
+*.pyc
 
 # Compiled Dynamic libraries
 *.so
index d0e47dae992d2d253f358a1ca48ae7c7124cab77..fdd70368b1fff4e8410080bded32de90d9e598f5 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 35e6d2cb9d88c66779c36504cc19fb632df824ed..32a65662eca85e5c8afc65c2a17ded449176f6b8 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 ddd13342b52d389c378b7f977a450f70eecbeea7..ff545cebcda3f795fa4994d15443165043a8a0cc 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