summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 40f456e)
raw | patch | inline | side by side (parent: 40f456e)
author | Yangqing Jia <jiayq84@gmail.com> | |
Tue, 24 Sep 2013 19:56:40 +0000 (12:56 -0700) | ||
committer | Yangqing Jia <jiayq84@gmail.com> | |
Tue, 24 Sep 2013 19:58:13 +0000 (12:58 -0700) |
.gitignore | patch | blob | history | |
src/caffe/blob.cpp | patch | blob | history | |
src/caffe/blob.hpp | patch | blob | history | |
src/caffe/proto/layer_param.proto | patch | blob | history | |
src/caffe/proto/layer_param_pb2.pyc | [deleted file] | patch | blob | history |
diff --git a/.gitignore b/.gitignore
index ca27edc412e61b21d3b08b2e9ded4a51e45c505e..14428f6da9c9bc09e9cf8468ac589b7c9809c6c9 100644 (file)
--- a/.gitignore
+++ b/.gitignore
*.lo
*.o
*.cuo
+*.pyc
# Compiled Dynamic libraries
*.so
diff --git a/src/caffe/blob.cpp b/src/caffe/blob.cpp
index d0e47dae992d2d253f358a1ca48ae7c7124cab77..fdd70368b1fff4e8410080bded32de90d9e598f5 100644 (file)
--- a/src/caffe/blob.cpp
+++ b/src/caffe/blob.cpp
}
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_);
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]);
+ }
}
}
diff --git a/src/caffe/blob.hpp b/src/caffe/blob.hpp
index 35e6d2cb9d88c66779c36504cc19fb632df824ed..32a65662eca85e5c8afc65c2a17ded449176f6b8 100644 (file)
--- a/src/caffe/blob.hpp
+++ b/src/caffe/blob.hpp
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)
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.
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
index 6e6c693..0000000
Binary files a/src/caffe/proto/layer_param_pb2.pyc and /dev/null differ