版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/zhjm07054115/article/details/52302869
转自 www.studyai.cn
//////////////////
caffe.proto文件注释,
caffe版本:MS-caffe-master github 2016.8.20
caffe版本:BVLC-caffe-master github 2016.8.20
//////////////////
syntax = "proto2";
package caffe;
// 数据块形状{指定Blob的形状或维度-4D}
message BlobShape {
//数据块形状定义为Num×Channel×Height×Wight原因在于caffe基于容器的多维嵌套
//来实现高维数据的封装。即vector(N)<vector(C)<img(H×W)>>。
repeated int64 dim = 1 [packed = true];
}
// 数据块{形状,数据,微分}
message BlobProto {
optional BlobShape shape = 7;
repeated float data = 5 [packed = true];
repeated float diff = 6 [packed = true];
repeated double double_data = 8 [packed = true];
repeated double double_diff = 9 [packed = true];
//数据4D形状 -- 旧版本,已使用"BlobShape shape"代替:
optional int32 num = 1 [default = 0]; //样本
optional int32 channels = 2 [default = 0];
optional int32 height = 3 [default = 0];
optional int32 width = 4 [default = 0];
}
// 存放多个BlobProto实例的对应Index,易于引用
message BlobProtoVector {
repeated BlobProto blobs = 1;
}
// 数据:{C,H,W,data(uchar&float),label} 图像样本
message Datum {
optional int32 channels = 1;
optional int32 height = 2;
optional int32 width = 3;
// the actual image data, in bytes
optional bytes data = 4;
optional int32 label = 5;
// Optionally, the datum could also hold float data.
repeated float float_data = 6;
// If true data contains an encoded image that need to be decoded
optional bool encoded = 7 [default = false];
}
//滤波器参数{Type(const|uniform|gauss),}
message FillerParameter {
// The filler type.
optional string type = 1 [default = 'constant'];
optional float value = 2 [default = 0]; // the value in constant filler
optional float min = 3 [default = 0]; // the min value in uniform filler
optional float max = 4 [default = 1]; // the max value in uniform filler
optional float mean = 5 [default = 0]; // the mean value in Gaussian filler
optional float std = 6 [default = 1]; // the std value in Gaussian filler
// 给定输入与权值相乘后应该得到非零输出,默认值-1意为不稀疏化高斯模板。
optional int32 sparse = 7 [default = -1];
// Normalize the filler variance by fan_in, fan_out, or their average.
// Applies to 'xavier' and 'msra' fillers.(扇入,扇出)
// 通过fanIn,fanOut,及其均值来归一化填充值的方差,有“xavier法”或“msra法”
enum VarianceNorm {
FAN_IN = 0;
FAN_OUT = 1;
AVERAGE = 2;
}
optional VarianceNorm variance_norm = 8 [default = FAN_IN];
}