caffe.proto 源码解析

转自 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];
}

全文请移步 www.studyai.cn, 阅读效果更佳

这里写图片描述

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值