1. 程式人生 > >【深度學習:caffe】Caffemodel解析

【深度學習:caffe】Caffemodel解析

1 message NetParameter { 2 3 optional string name = 1; // 網路名稱 4 5 repeated string input = 3; // 網路輸入input blobs 6 7 repeated BlobShape input_shape = 8; // The shape of the input blobs 8 9 // 輸入維度blobs,4維(num, channels, height and width) 10 11 repeated int32 input_dim = 4
; 12 13 // 網路是否強制每層進行反饋操作開關 14 15 // 如果設定為False,則會根據網路結構和學習率自動確定是否進行反饋操作 16 17 optional bool force_backward = 5 [default = false]; 18 19 // 網路的state,部分網路層依賴,部分不依賴,需要看具體網路 20 21 optional NetState state = 6; 22 23 // 是否列印debug log 24 25 optional bool debug_info = 7 [default = false
]; 26 27 // 網路層引數,Field Number 為100,所以網路層引數在最後 28 29 repeated LayerParameter layer = 100; 30 31 // 棄用: 用 'layer' 代替 32 33 repeated V1LayerParameter layers = 2; 34 35 } 36 37 // Specifies the shape (dimensions) of a Blob. 38 39 message BlobShape { 40 41 repeated int64 dim = 1 [packed = true
]; 42 43 } 44 45 message BlobProto { 46 47 optional BlobShape shape = 7; 48 49 repeated float data = 5 [packed = true]; 50 51 repeated float diff = 6 [packed = true]; 52 53 optional int32 num = 1 [default = 0]; 54 55 optional int32 channels = 2 [default = 0]; 56 57 optional int32 height = 3 [default = 0]; 58 59 optional int32 width = 4 [default = 0]; 60 61 } 62 63 64 65 // The BlobProtoVector is simply a way to pass multiple blobproto instances 66 67 around. 68 69 message BlobProtoVector { 70 71 repeated BlobProto blobs = 1; 72 73 } 74 75 message NetState { 76 77 optional Phase phase = 1 [default = TEST]; 78 79 optional int32 level = 2 [default = 0]; 80 81 repeated string stage = 3; 82 83 } 84 85 message LayerParameter { 86 87 optional string name = 1; // the layer name 88 89 optional string type = 2; // the layer type 90 91 repeated string bottom = 3; // the name of each bottom blob 92 93 repeated string top = 4; // the name of each top blob 94 95 // The train/test phase for computation. 96 97 optional Phase phase = 10; 98 99 // Loss weight值:float 100 101 // 每一層為每一個top blob都分配了一個預設值,通常是0或1 102 103 repeated float loss_weight = 5; 104 105 // 指定的學習引數 106 107 repeated ParamSpec param = 6; 108 109 // The blobs containing the numeric parameters of the layer. 110 111 repeated BlobProto blobs = 7; 112 113 // included/excluded. 114 115 repeated NetStateRule include = 8; 116 117 repeated NetStateRule exclude = 9; 118 119 // Parameters for data pre-processing. 120 121 optional TransformationParameter transform_param = 100; 122 123 // Parameters shared by loss layers. 124 125 optional LossParameter loss_param = 101; 126 127 // 各種型別層引數 128 129 optional AccuracyParameter accuracy_param = 102; 130 131 optional ArgMaxParameter argmax_param = 103; 132 133 optional ConcatParameter concat_param = 104; 134 135 optional ContrastiveLossParameter contrastive_loss_param = 105; 136 137 optional ConvolutionParameter convolution_param = 106; 138 139 optional DataParameter data_param = 107; 140 141 optional DropoutParameter dropout_param = 108; 142 143 optional DummyDataParameter dummy_data_param = 109; 144 145 optional EltwiseParameter eltwise_param = 110; 146 147 optional ExpParameter exp_param = 111; 148 149 optional HDF5DataParameter hdf5_data_param = 112; 150 151 optional HDF5OutputParameter hdf5_output_param = 113; 152 153 optional HingeLossParameter hinge_loss_param = 114; 154 155 optional ImageDataParameter image_data_param = 115; 156 157 optional InfogainLossParameter infogain_loss_param = 116; 158 159 optional InnerProductParameter inner_product_param = 117; 160 161 optional LRNParameter lrn_param = 118; 162 163 optional MemoryDataParameter memory_data_param = 119; 164 165 optional MVNParameter mvn_param = 120; 166 167 optional PoolingParameter pooling_param = 121; 168 169 optional PowerParameter power_param = 122; 170 171 optional PythonParameter python_param = 130; 172 173 optional ReLUParameter relu_param = 123; 174 175 optional SigmoidParameter sigmoid_param = 124; 176 177 optional SoftmaxParameter softmax_param = 125; 178 179 optional SliceParameter slice_param = 126; 180 181 optional TanHParameter tanh_param = 127; 182 183 optional ThresholdParameter threshold_param = 128; 184 185 optional WindowDataParameter window_data_param = 129; 186 187 }