caffe源码解析-caffe.proto.docxVIP

  • 10
  • 0
  • 约2.18万字
  • 约 18页
  • 2017-04-12 发布于四川
  • 举报
caffe源码解析-caffe.proto

要看caffe源码,首先应该看的就是caffe.proto。? 它位于…\src\caffe\proto目录下,在这个文件夹下还有一个.pb.cc和一个.pb.h文件,这两个文件都是由caffe.proto编译而来的。? 在caffe.proto中定义了很多结构化数据,包括: BlobProto Datum FillerParameter NetParameter SolverParameter SolverState LayerParameter ConcatParameter ConvolutionParameter DataParameter DropoutParameter HDF5DataParameter HDF5OutputParameter ImageDataParameter InfogainLossParameter InnerProductParameter LRNParameter MemoryDataParameter PoolingParameter PowerParameter WindowDataParameter V0LayerParameter caffe.proto中的几个重要数据类型 caffe.pb.cc里面的东西都是从caffe.proto编译而来的,无非就是一些关于这些数据结构(类)的标准化操作,比如 void CopyFrom(); void MergeFrom(); void Clear(); bool IsInitialized() const; int ByteSize() const; bool MergePartialFromCodedStream(); void SerializeWithCachedSizes() const; SerializeWithCachedSizesToArray() const; int GetCachedSize() void SharedCtor(); void SharedDtor(); void SetCachedSize() const; 0 BlobProto message BlobProto {//blob的属性以及blob中的数据(data\diff) optional int32 num = 1 [default = 0]; optional int32 channels = 2 [default = 0]; optional int32 height = 3 [default = 0]; optional int32 width = 4 [default = 0]; repeated float data = 5 [packed = true]; repeated float diff = 6 [packed = true]; } 1 Datum message Datum { optional int32 channels = 1; optional int32 height = 2; optional int32 width = 3; optional bytes data = 4;//真实的图像数据,以字节存储(bytes) optional int32 label = 5; repeated float float_data = 6;//datum也能存float类型的数据(float) } 2 LayerParameter message LayerParameter { repeated string bottom = 2; //输入的blob的名字(string) repeated string top = 3; //输出的blob的名字(string) optional string name = 4; //层的名字 enum LayerType { //层的枚举(enum,和c++中的enum一样) NONE = 0; ACCURACY = 1; BNLL = 2; CONCAT = 3; CONVOLUTION = 4; DATA = 5; DROPOUT = 6; EUCLIDEAN_LOSS = 7; ELTWISE_PRODUCT = 25; FLATTEN = 8; HDF5_DATA = 9; HDF5_OUTPUT = 10; HINGE_LOSS = 28; IM2COL = 11; IMAGE_DATA = 12; INFOGAIN_LOS

文档评论(0)

1亿VIP精品文档

相关文档