You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

caffe.proto 68 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663
  1. syntax = "proto2";
  2. package caffe;
  3. // Specifies the shape (dimensions) of a Blob.
  4. message BlobShape {
  5. repeated int64 dim = 1 [packed = true];
  6. }
  7. message BlobProto {
  8. optional BlobShape shape = 7;
  9. repeated float data = 5 [packed = true];
  10. repeated float diff = 6 [packed = true];
  11. repeated double double_data = 8 [packed = true];
  12. repeated double double_diff = 9 [packed = true];
  13. // 4D dimensions -- deprecated. Use "shape" instead.
  14. optional int32 num = 1 [default = 0];
  15. optional int32 channels = 2 [default = 0];
  16. optional int32 height = 3 [default = 0];
  17. optional int32 width = 4 [default = 0];
  18. }
  19. // The BlobProtoVector is simply a way to pass multiple blobproto instances
  20. // around.
  21. message BlobProtoVector {
  22. repeated BlobProto blobs = 1;
  23. }
  24. message Datum {
  25. optional int32 channels = 1;
  26. optional int32 height = 2;
  27. optional int32 width = 3;
  28. // the actual image data, in bytes
  29. optional bytes data = 4;
  30. optional int32 label = 5;
  31. // Optionally, the datum could also hold float data.
  32. repeated float float_data = 6;
  33. // If true data contains an encoded image that need to be decoded
  34. optional bool encoded = 7 [default = false];
  35. }
  36. message FillerParameter {
  37. // The filler type.
  38. optional string type = 1 [default = 'constant'];
  39. optional float value = 2 [default = 0]; // the value in constant filler
  40. optional float min = 3 [default = 0]; // the min value in uniform filler
  41. optional float max = 4 [default = 1]; // the max value in uniform filler
  42. optional float mean = 5 [default = 0]; // the mean value in Gaussian filler
  43. optional float std = 6 [default = 1]; // the std value in Gaussian filler
  44. // The expected number of non-zero output weights for a given input in
  45. // Gaussian filler -- the default -1 means don't perform sparsification.
  46. optional int32 sparse = 7 [default = -1];
  47. // Normalize the filler variance by fan_in, fan_out, or their average.
  48. // Applies to 'xavier' and 'msra' fillers.
  49. enum VarianceNorm {
  50. FAN_IN = 0;
  51. FAN_OUT = 1;
  52. AVERAGE = 2;
  53. }
  54. optional VarianceNorm variance_norm = 8 [default = FAN_IN];
  55. }
  56. message NetParameter {
  57. optional string name = 1; // consider giving the network a name
  58. // DEPRECATED. See InputParameter. The input blobs to the network.
  59. repeated string input = 3;
  60. // DEPRECATED. See InputParameter. The shape of the input blobs.
  61. repeated BlobShape input_shape = 8;
  62. // 4D input dimensions -- deprecated. Use "input_shape" instead.
  63. // If specified, for each input blob there should be four
  64. // values specifying the num, channels, height and width of the input blob.
  65. // Thus, there should be a total of (4 * #input) numbers.
  66. repeated int32 input_dim = 4;
  67. // Whether the network will force every layer to carry out backward operation.
  68. // If set False, then whether to carry out backward is determined
  69. // automatically according to the net structure and learning rates.
  70. optional bool force_backward = 5 [default = false];
  71. // The current "state" of the network, including the phase, level, and stage.
  72. // Some layers may be included/excluded depending on this state and the states
  73. // specified in the layers' include and exclude fields.
  74. optional NetState state = 6;
  75. // Print debugging information about results while running Net::Forward,
  76. // Net::Backward, and Net::Update.
  77. optional bool debug_info = 7 [default = false];
  78. // The layers that make up the net. Each of their configurations, including
  79. // connectivity and behavior, is specified as a LayerParameter.
  80. repeated LayerParameter layer = 100; // ID 100 so layers are printed last.
  81. // DEPRECATED: use 'layer' instead.
  82. repeated V1LayerParameter layers = 2;
  83. }
  84. // NOTE
  85. // Update the next available ID when you add a new SolverParameter field.
  86. //
  87. // SolverParameter next available ID: 41 (last added: type)
  88. message SolverParameter {
  89. //////////////////////////////////////////////////////////////////////////////
  90. // Specifying the train and test networks
  91. //
  92. // Exactly one train net must be specified using one of the following fields:
  93. // train_net_param, train_net, net_param, net
  94. // One or more test nets may be specified using any of the following fields:
  95. // test_net_param, test_net, net_param, net
  96. // If more than one test net field is specified (e.g., both net and
  97. // test_net are specified), they will be evaluated in the field order given
  98. // above: (1) test_net_param, (2) test_net, (3) net_param/net.
  99. // A test_iter must be specified for each test_net.
  100. // A test_level and/or a test_stage may also be specified for each test_net.
  101. //////////////////////////////////////////////////////////////////////////////
  102. // Proto filename for the train net, possibly combined with one or more
  103. // test nets.
  104. optional string net = 24;
  105. // Inline train net param, possibly combined with one or more test nets.
  106. optional NetParameter net_param = 25;
  107. optional string train_net = 1; // Proto filename for the train net.
  108. repeated string test_net = 2; // Proto filenames for the test nets.
  109. optional NetParameter train_net_param = 21; // Inline train net params.
  110. repeated NetParameter test_net_param = 22; // Inline test net params.
  111. // The states for the train/test nets. Must be unspecified or
  112. // specified once per net.
  113. //
  114. // By default, all states will have solver = true;
  115. // train_state will have phase = TRAIN,
  116. // and all test_state's will have phase = TEST.
  117. // Other defaults are set according to the NetState defaults.
  118. optional NetState train_state = 26;
  119. repeated NetState test_state = 27;
  120. // The number of iterations for each test net.
  121. repeated int32 test_iter = 3;
  122. // The number of iterations between two testing phases.
  123. optional int32 test_interval = 4 [default = 0];
  124. optional bool test_compute_loss = 19 [default = false];
  125. // If true, run an initial test pass before the first iteration,
  126. // ensuring memory availability and printing the starting value of the loss.
  127. optional bool test_initialization = 32 [default = true];
  128. optional float base_lr = 5; // The base learning rate
  129. // the number of iterations between displaying info. If display = 0, no info
  130. // will be displayed.
  131. optional int32 display = 6;
  132. // Display the loss averaged over the last average_loss iterations
  133. optional int32 average_loss = 33 [default = 1];
  134. optional int32 max_iter = 7; // the maximum number of iterations
  135. // accumulate gradients over `iter_size` x `batch_size` instances
  136. optional int32 iter_size = 36 [default = 1];
  137. // The learning rate decay policy. The currently implemented learning rate
  138. // policies are as follows:
  139. // - fixed: always return base_lr.
  140. // - step: return base_lr * gamma ^ (floor(iter / step))
  141. // - exp: return base_lr * gamma ^ iter
  142. // - inv: return base_lr * (1 + gamma * iter) ^ (- power)
  143. // - multistep: similar to step but it allows non uniform steps defined by
  144. // stepvalue
  145. // - poly: the effective learning rate follows a polynomial decay, to be
  146. // zero by the max_iter. return base_lr (1 - iter/max_iter) ^ (power)
  147. // - sigmoid: the effective learning rate follows a sigmod decay
  148. // return base_lr ( 1/(1 + exp(-gamma * (iter - stepsize))))
  149. //
  150. // where base_lr, max_iter, gamma, step, stepvalue and power are defined
  151. // in the solver parameter protocol buffer, and iter is the current iteration.
  152. optional string lr_policy = 8;
  153. optional float gamma = 9; // The parameter to compute the learning rate.
  154. optional float power = 10; // The parameter to compute the learning rate.
  155. optional float momentum = 11; // The momentum value.
  156. optional float weight_decay = 12; // The weight decay.
  157. // regularization types supported: L1 and L2
  158. // controlled by weight_decay
  159. optional string regularization_type = 29 [default = "L2"];
  160. // the stepsize for learning rate policy "step"
  161. optional int32 stepsize = 13;
  162. // the stepsize for learning rate policy "multistep"
  163. repeated int32 stepvalue = 34;
  164. // Set clip_gradients to >= 0 to clip parameter gradients to that L2 norm,
  165. // whenever their actual L2 norm is larger.
  166. optional float clip_gradients = 35 [default = -1];
  167. optional int32 snapshot = 14 [default = 0]; // The snapshot interval
  168. optional string snapshot_prefix = 15; // The prefix for the snapshot.
  169. // whether to snapshot diff in the results or not. Snapshotting diff will help
  170. // debugging but the final protocol buffer size will be much larger.
  171. optional bool snapshot_diff = 16 [default = false];
  172. enum SnapshotFormat {
  173. HDF5 = 0;
  174. BINARYPROTO = 1;
  175. }
  176. optional SnapshotFormat snapshot_format = 37 [default = BINARYPROTO];
  177. // the mode solver will use: 0 for CPU and 1 for GPU. Use GPU in default.
  178. enum SolverMode {
  179. CPU = 0;
  180. GPU = 1;
  181. }
  182. optional SolverMode solver_mode = 17 [default = GPU];
  183. // the device_id will that be used in GPU mode. Use device_id = 0 in default.
  184. optional int32 device_id = 18 [default = 0];
  185. // If non-negative, the seed with which the Solver will initialize the Caffe
  186. // random number generator -- useful for reproducible results. Otherwise,
  187. // (and by default) initialize using a seed derived from the system clock.
  188. optional int64 random_seed = 20 [default = -1];
  189. // type of the solver
  190. optional string type = 40 [default = "SGD"];
  191. // numerical stability for RMSProp, AdaGrad and AdaDelta and Adam
  192. optional float delta = 31 [default = 1e-8];
  193. // parameters for the Adam solver
  194. optional float momentum2 = 39 [default = 0.999];
  195. // RMSProp decay value
  196. // MeanSquare(t) = rms_decay*MeanSquare(t-1) + (1-rms_decay)*SquareGradient(t)
  197. optional float rms_decay = 38;
  198. // If true, print information about the state of the net that may help with
  199. // debugging learning problems.
  200. optional bool debug_info = 23 [default = false];
  201. // If false, don't save a snapshot after training finishes.
  202. optional bool snapshot_after_train = 28 [default = true];
  203. // DEPRECATED: old solver enum types, use string instead
  204. enum SolverType {
  205. SGD = 0;
  206. NESTEROV = 1;
  207. ADAGRAD = 2;
  208. RMSPROP = 3;
  209. ADADELTA = 4;
  210. ADAM = 5;
  211. }
  212. // DEPRECATED: use type instead of solver_type
  213. optional SolverType solver_type = 30 [default = SGD];
  214. }
  215. // A message that stores the solver snapshots
  216. message SolverState {
  217. optional int32 iter = 1; // The current iteration
  218. optional string learned_net = 2; // The file that stores the learned net.
  219. repeated BlobProto history = 3; // The history for sgd solvers
  220. optional int32 current_step = 4 [default = 0]; // The current step for learning rate
  221. }
  222. enum Phase {
  223. TRAIN = 0;
  224. TEST = 1;
  225. }
  226. message NetState {
  227. optional Phase phase = 1 [default = TEST];
  228. optional int32 level = 2 [default = 0];
  229. repeated string stage = 3;
  230. }
  231. message NetStateRule {
  232. // Set phase to require the NetState have a particular phase (TRAIN or TEST)
  233. // to meet this rule.
  234. optional Phase phase = 1;
  235. // Set the minimum and/or maximum levels in which the layer should be used.
  236. // Leave undefined to meet the rule regardless of level.
  237. optional int32 min_level = 2;
  238. optional int32 max_level = 3;
  239. // Customizable sets of stages to include or exclude.
  240. // The net must have ALL of the specified stages and NONE of the specified
  241. // "not_stage"s to meet the rule.
  242. // (Use multiple NetStateRules to specify conjunctions of stages.)
  243. repeated string stage = 4;
  244. repeated string not_stage = 5;
  245. }
  246. // Specifies training parameters (multipliers on global learning constants,
  247. // and the name and other settings used for weight sharing).
  248. message ParamSpec {
  249. // The names of the parameter blobs -- useful for sharing parameters among
  250. // layers, but never required otherwise. To share a parameter between two
  251. // layers, give it a (non-empty) name.
  252. optional string name = 1;
  253. // Whether to require shared weights to have the same shape, or just the same
  254. // count -- defaults to STRICT if unspecified.
  255. optional DimCheckMode share_mode = 2;
  256. enum DimCheckMode {
  257. // STRICT (default) requires that num, channels, height, width each match.
  258. STRICT = 0;
  259. // PERMISSIVE requires only the count (num*channels*height*width) to match.
  260. PERMISSIVE = 1;
  261. }
  262. // The multiplier on the global learning rate for this parameter.
  263. optional float lr_mult = 3 [default = 1.0];
  264. // The multiplier on the global weight decay for this parameter.
  265. optional float decay_mult = 4 [default = 1.0];
  266. }
  267. // NOTE
  268. // Update the next available ID when you add a new LayerParameter field.
  269. //
  270. // LayerParameter next available layer-specific ID: 146 (last added: shuffle_channel_param)
  271. message LayerParameter {
  272. optional string name = 1; // the layer name
  273. optional string type = 2; // the layer type
  274. repeated string bottom = 3; // the name of each bottom blob
  275. repeated string top = 4; // the name of each top blob
  276. // The train / test phase for computation.
  277. optional Phase phase = 10;
  278. // The amount of weight to assign each top blob in the objective.
  279. // Each layer assigns a default value, usually of either 0 or 1,
  280. // to each top blob.
  281. repeated float loss_weight = 5;
  282. // Specifies training parameters (multipliers on global learning constants,
  283. // and the name and other settings used for weight sharing).
  284. repeated ParamSpec param = 6;
  285. // The blobs containing the numeric parameters of the layer.
  286. repeated BlobProto blobs = 7;
  287. // Specifies whether to backpropagate to each bottom. If unspecified,
  288. // Caffe will automatically infer whether each input needs backpropagation
  289. // to compute parameter gradients. If set to true for some inputs,
  290. // backpropagation to those inputs is forced; if set false for some inputs,
  291. // backpropagation to those inputs is skipped.
  292. //
  293. // The size must be either 0 or equal to the number of bottoms.
  294. repeated bool propagate_down = 11;
  295. // Rules controlling whether and when a layer is included in the network,
  296. // based on the current NetState. You may specify a non-zero number of rules
  297. // to include OR exclude, but not both. If no include or exclude rules are
  298. // specified, the layer is always included. If the current NetState meets
  299. // ANY (i.e., one or more) of the specified rules, the layer is
  300. // included/excluded.
  301. repeated NetStateRule include = 8;
  302. repeated NetStateRule exclude = 9;
  303. // Parameters for data pre-processing.
  304. optional TransformationParameter transform_param = 100;
  305. // Parameters shared by loss layers.
  306. optional LossParameter loss_param = 101;
  307. // Layer type-specific parameters.
  308. //
  309. // Note: certain layers may have more than one computational engine
  310. // for their implementation. These layers include an Engine type and
  311. // engine parameter for selecting the implementation.
  312. // The default for the engine is set by the ENGINE switch at compile-time.
  313. optional AccuracyParameter accuracy_param = 102;
  314. optional ArgMaxParameter argmax_param = 103;
  315. optional BatchNormParameter batch_norm_param = 139;
  316. optional BiasParameter bias_param = 141;
  317. optional BNParameter bn_param = 45;
  318. optional ConcatParameter concat_param = 104;
  319. optional ContrastiveLossParameter contrastive_loss_param = 105;
  320. optional ConvolutionParameter convolution_param = 106;
  321. optional CropParameter crop_param = 144;
  322. optional DataParameter data_param = 107;
  323. optional DetectionOutputParameter detection_output_param = 204;
  324. optional YoloDetectionOutputParameter yolo_detection_output_param = 601;
  325. optional Yolov3DetectionOutputParameter yolov3_detection_output_param = 603;
  326. optional DropoutParameter dropout_param = 108;
  327. optional DummyDataParameter dummy_data_param = 109;
  328. optional EltwiseParameter eltwise_param = 110;
  329. optional ELUParameter elu_param = 140;
  330. optional EmbedParameter embed_param = 137;
  331. optional ExpParameter exp_param = 111;
  332. optional FlattenParameter flatten_param = 135;
  333. optional HDF5DataParameter hdf5_data_param = 112;
  334. optional HDF5OutputParameter hdf5_output_param = 113;
  335. optional HingeLossParameter hinge_loss_param = 114;
  336. optional ImageDataParameter image_data_param = 115;
  337. optional InfogainLossParameter infogain_loss_param = 116;
  338. optional InnerProductParameter inner_product_param = 117;
  339. optional InputParameter input_param = 143;
  340. optional InterpParameter interp_param = 205;
  341. optional LogParameter log_param = 134;
  342. optional LRNParameter lrn_param = 118;
  343. optional MemoryDataParameter memory_data_param = 119;
  344. optional MVNParameter mvn_param = 120;
  345. optional NormalizeParameter norm_param = 206;
  346. optional PoolingParameter pooling_param = 121;
  347. optional PermuteParameter permute_param = 202;
  348. optional PowerParameter power_param = 122;
  349. optional PReLUParameter prelu_param = 131;
  350. optional PriorBoxParameter prior_box_param = 203;
  351. optional PSROIPoolingParameter psroi_pooling_param = 149;
  352. optional PythonParameter python_param = 130;
  353. optional RecurrentParameter recurrent_param = 146;
  354. optional ReductionParameter reduction_param = 136;
  355. optional ReLUParameter relu_param = 123;
  356. optional ReorgParameter reorg_param = 147;
  357. optional ReshapeParameter reshape_param = 133;
  358. optional ROIAlignParameter roi_align_param = 148;
  359. optional ROIPoolingParameter roi_pooling_param = 8266711;
  360. optional ScaleParameter scale_param = 142;
  361. optional ShuffleChannelParameter shuffle_channel_param = 145;
  362. optional SigmoidParameter sigmoid_param = 124;
  363. optional SmoothL1LossParameter smooth_l1_loss_param = 8266712;
  364. optional SoftmaxParameter softmax_param = 125;
  365. optional SPPParameter spp_param = 132;
  366. optional SliceParameter slice_param = 126;
  367. optional TanHParameter tanh_param = 127;
  368. optional ThresholdParameter threshold_param = 128;
  369. optional TileParameter tile_param = 138;
  370. optional WindowDataParameter window_data_param = 129;
  371. }
  372. // Message that stores parameters used to apply transformation
  373. // to the data layer's data
  374. message TransformationParameter {
  375. // For data pre-processing, we can do simple scaling and subtracting the
  376. // data mean, if provided. Note that the mean subtraction is always carried
  377. // out before scaling.
  378. optional float scale = 1 [default = 1];
  379. // Specify if we want to randomly mirror data.
  380. optional bool mirror = 2 [default = false];
  381. // Specify if we would like to randomly crop an image.
  382. optional uint32 crop_size = 3 [default = 0];
  383. // mean_file and mean_value cannot be specified at the same time
  384. optional string mean_file = 4;
  385. // if specified can be repeated once (would substract it from all the channels)
  386. // or can be repeated the same number of times as channels
  387. // (would subtract them from the corresponding channel)
  388. repeated float mean_value = 5;
  389. // Force the decoded image to have 3 color channels.
  390. optional bool force_color = 6 [default = false];
  391. // Force the decoded image to have 1 color channels.
  392. optional bool force_gray = 7 [default = false];
  393. }
  394. // Message that stores parameters used by data transformer for resize policy
  395. message ResizeParameter {
  396. //Probability of using this resize policy
  397. optional float prob = 1 [default = 1];
  398. enum Resize_mode {
  399. WARP = 1;
  400. FIT_SMALL_SIZE = 2;
  401. FIT_LARGE_SIZE_AND_PAD = 3;
  402. }
  403. optional Resize_mode resize_mode = 2 [default = WARP];
  404. optional uint32 height = 3 [default = 0];
  405. optional uint32 width = 4 [default = 0];
  406. // A parameter used to update bbox in FIT_SMALL_SIZE mode.
  407. optional uint32 height_scale = 8 [default = 0];
  408. optional uint32 width_scale = 9 [default = 0];
  409. enum Pad_mode {
  410. CONSTANT = 1;
  411. MIRRORED = 2;
  412. REPEAT_NEAREST = 3;
  413. }
  414. // Padding mode for BE_SMALL_SIZE_AND_PAD mode and object centering
  415. optional Pad_mode pad_mode = 5 [default = CONSTANT];
  416. // if specified can be repeated once (would fill all the channels)
  417. // or can be repeated the same number of times as channels
  418. // (would use it them to the corresponding channel)
  419. repeated float pad_value = 6;
  420. enum Interp_mode { //Same as in OpenCV
  421. LINEAR = 1;
  422. AREA = 2;
  423. NEAREST = 3;
  424. CUBIC = 4;
  425. LANCZOS4 = 5;
  426. }
  427. //interpolation for for resizing
  428. repeated Interp_mode interp_mode = 7;
  429. }
  430. // Message that stores parameters shared by loss layers
  431. message LossParameter {
  432. // If specified, ignore instances with the given label.
  433. optional int32 ignore_label = 1;
  434. // How to normalize the loss for loss layers that aggregate across batches,
  435. // spatial dimensions, or other dimensions. Currently only implemented in
  436. // SoftmaxWithLoss layer.
  437. enum NormalizationMode {
  438. // Divide by the number of examples in the batch times spatial dimensions.
  439. // Outputs that receive the ignore label will NOT be ignored in computing
  440. // the normalization factor.
  441. FULL = 0;
  442. // Divide by the total number of output locations that do not take the
  443. // ignore_label. If ignore_label is not set, this behaves like FULL.
  444. VALID = 1;
  445. // Divide by the batch size.
  446. BATCH_SIZE = 2;
  447. // Do not normalize the loss.
  448. NONE = 3;
  449. }
  450. optional NormalizationMode normalization = 3 [default = VALID];
  451. // Deprecated. Ignored if normalization is specified. If normalization
  452. // is not specified, then setting this to false will be equivalent to
  453. // normalization = BATCH_SIZE to be consistent with previous behavior.
  454. optional bool normalize = 2;
  455. }
  456. // Messages that store parameters used by individual layer types follow, in
  457. // alphabetical order.
  458. message AccuracyParameter {
  459. // When computing accuracy, count as correct by comparing the true label to
  460. // the top k scoring classes. By default, only compare to the top scoring
  461. // class (i.e. argmax).
  462. optional uint32 top_k = 1 [default = 1];
  463. // The "label" axis of the prediction blob, whose argmax corresponds to the
  464. // predicted label -- may be negative to index from the end (e.g., -1 for the
  465. // last axis). For example, if axis == 1 and the predictions are
  466. // (N x C x H x W), the label blob is expected to contain N*H*W ground truth
  467. // labels with integer values in {0, 1, ..., C-1}.
  468. optional int32 axis = 2 [default = 1];
  469. // If specified, ignore instances with the given label.
  470. optional int32 ignore_label = 3;
  471. }
  472. message ArgMaxParameter {
  473. // If true produce pairs (argmax, maxval)
  474. optional bool out_max_val = 1 [default = false];
  475. optional uint32 top_k = 2 [default = 1];
  476. // The axis along which to maximise -- may be negative to index from the
  477. // end (e.g., -1 for the last axis).
  478. // By default ArgMaxLayer maximizes over the flattened trailing dimensions
  479. // for each index of the first / num dimension.
  480. optional int32 axis = 3;
  481. }
  482. message ConcatParameter {
  483. // The axis along which to concatenate -- may be negative to index from the
  484. // end (e.g., -1 for the last axis). Other axes must have the
  485. // same dimension for all the bottom blobs.
  486. // By default, ConcatLayer concatenates blobs along the "channels" axis (1).
  487. optional int32 axis = 2 [default = 1];
  488. // DEPRECATED: alias for "axis" -- does not support negative indexing.
  489. optional uint32 concat_dim = 1 [default = 1];
  490. }
  491. message BatchNormParameter {
  492. // If false, accumulate global mean/variance values via a moving average. If
  493. // true, use those accumulated values instead of computing mean/variance
  494. // across the batch.
  495. optional bool use_global_stats = 1;
  496. // How much does the moving average decay each iteration?
  497. optional float moving_average_fraction = 2 [default = .999];
  498. // Small value to add to the variance estimate so that we don't divide by
  499. // zero.
  500. optional float eps = 3 [default = 1e-5];
  501. }
  502. message BiasParameter {
  503. // The first axis of bottom[0] (the first input Blob) along which to apply
  504. // bottom[1] (the second input Blob). May be negative to index from the end
  505. // (e.g., -1 for the last axis).
  506. //
  507. // For example, if bottom[0] is 4D with shape 100x3x40x60, the output
  508. // top[0] will have the same shape, and bottom[1] may have any of the
  509. // following shapes (for the given value of axis):
  510. // (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60
  511. // (axis == 1 == -3) 3; 3x40; 3x40x60
  512. // (axis == 2 == -2) 40; 40x60
  513. // (axis == 3 == -1) 60
  514. // Furthermore, bottom[1] may have the empty shape (regardless of the value of
  515. // "axis") -- a scalar bias.
  516. optional int32 axis = 1 [default = 1];
  517. // (num_axes is ignored unless just one bottom is given and the bias is
  518. // a learned parameter of the layer. Otherwise, num_axes is determined by the
  519. // number of axes by the second bottom.)
  520. // The number of axes of the input (bottom[0]) covered by the bias
  521. // parameter, or -1 to cover all axes of bottom[0] starting from `axis`.
  522. // Set num_axes := 0, to add a zero-axis Blob: a scalar.
  523. optional int32 num_axes = 2 [default = 1];
  524. // (filler is ignored unless just one bottom is given and the bias is
  525. // a learned parameter of the layer.)
  526. // The initialization for the learned bias parameter.
  527. // Default is the zero (0) initialization, resulting in the BiasLayer
  528. // initially performing the identity operation.
  529. optional FillerParameter filler = 3;
  530. }
  531. // Message that stores parameters used by BN (Batch Normalization) layer
  532. message BNParameter {
  533. enum BNMode {
  534. LEARN = 0;
  535. INFERENCE = 1;
  536. }
  537. optional BNMode bn_mode = 3 [default = LEARN];
  538. optional FillerParameter scale_filler = 1; // The filler for the scale
  539. optional FillerParameter shift_filler = 2; // The filler for the shift
  540. }
  541. message ContrastiveLossParameter {
  542. // margin for dissimilar pair
  543. optional float margin = 1 [default = 1.0];
  544. // The first implementation of this cost did not exactly match the cost of
  545. // Hadsell et al 2006 -- using (margin - d^2) instead of (margin - d)^2.
  546. // legacy_version = false (the default) uses (margin - d)^2 as proposed in the
  547. // Hadsell paper. New models should probably use this version.
  548. // legacy_version = true uses (margin - d^2). This is kept to support /
  549. // reproduce existing models and results
  550. optional bool legacy_version = 2 [default = false];
  551. }
  552. message ConvolutionParameter {
  553. optional uint32 num_output = 1; // The number of outputs for the layer
  554. optional bool bias_term = 2 [default = true]; // whether to have bias terms
  555. // Pad, kernel size, and stride are all given as a single value for equal
  556. // dimensions in all spatial dimensions, or once per spatial dimension.
  557. repeated uint32 pad = 3; // The padding size; defaults to 0
  558. repeated uint32 kernel_size = 4; // The kernel size
  559. repeated uint32 stride = 6; // The stride; defaults to 1
  560. // Factor used to dilate the kernel, (implicitly) zero-filling the resulting
  561. // holes. (Kernel dilation is sometimes referred to by its use in the
  562. // algorithme à trous from Holschneider et al. 1987.)
  563. repeated uint32 dilation = 18; // The dilation; defaults to 1
  564. // For 2D convolution only, the *_h and *_w versions may also be used to
  565. // specify both spatial dimensions.
  566. optional uint32 pad_h = 9 [default = 0]; // The padding height (2D only)
  567. optional uint32 pad_w = 10 [default = 0]; // The padding width (2D only)
  568. optional uint32 kernel_h = 11; // The kernel height (2D only)
  569. optional uint32 kernel_w = 12; // The kernel width (2D only)
  570. optional uint32 stride_h = 13; // The stride height (2D only)
  571. optional uint32 stride_w = 14; // The stride width (2D only)
  572. optional uint32 group = 5 [default = 1]; // The group size for group conv
  573. optional FillerParameter weight_filler = 7; // The filler for the weight
  574. optional FillerParameter bias_filler = 8; // The filler for the bias
  575. enum Engine {
  576. DEFAULT = 0;
  577. CAFFE = 1;
  578. CUDNN = 2;
  579. }
  580. optional Engine engine = 15 [default = DEFAULT];
  581. // The axis to interpret as "channels" when performing convolution.
  582. // Preceding dimensions are treated as independent inputs;
  583. // succeeding dimensions are treated as "spatial".
  584. // With (N, C, H, W) inputs, and axis == 1 (the default), we perform
  585. // N independent 2D convolutions, sliding C-channel (or (C/g)-channels, for
  586. // groups g>1) filters across the spatial axes (H, W) of the input.
  587. // With (N, C, D, H, W) inputs, and axis == 1, we perform
  588. // N independent 3D convolutions, sliding (C/g)-channels
  589. // filters across the spatial axes (D, H, W) of the input.
  590. optional int32 axis = 16 [default = 1];
  591. // Whether to force use of the general ND convolution, even if a specific
  592. // implementation for blobs of the appropriate number of spatial dimensions
  593. // is available. (Currently, there is only a 2D-specific convolution
  594. // implementation; for input blobs with num_axes != 2, this option is
  595. // ignored and the ND implementation will be used.)
  596. optional bool force_nd_im2col = 17 [default = false];
  597. }
  598. message CropParameter {
  599. // To crop, elements of the first bottom are selected to fit the dimensions
  600. // of the second, reference bottom. The crop is configured by
  601. // - the crop `axis` to pick the dimensions for cropping
  602. // - the crop `offset` to set the shift for all/each dimension
  603. // to align the cropped bottom with the reference bottom.
  604. // All dimensions up to but excluding `axis` are preserved, while
  605. // the dimensions including and trailing `axis` are cropped.
  606. // If only one `offset` is set, then all dimensions are offset by this amount.
  607. // Otherwise, the number of offsets must equal the number of cropped axes to
  608. // shift the crop in each dimension accordingly.
  609. // Note: standard dimensions are N,C,H,W so the default is a spatial crop,
  610. // and `axis` may be negative to index from the end (e.g., -1 for the last
  611. // axis).
  612. optional int32 axis = 1 [default = 2];
  613. repeated uint32 offset = 2;
  614. }
  615. message DataParameter {
  616. enum DB {
  617. LEVELDB = 0;
  618. LMDB = 1;
  619. }
  620. // Specify the data source.
  621. optional string source = 1;
  622. // Specify the batch size.
  623. optional uint32 batch_size = 4;
  624. // The rand_skip variable is for the data layer to skip a few data points
  625. // to avoid all asynchronous sgd clients to start at the same point. The skip
  626. // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  627. // be larger than the number of keys in the database.
  628. // DEPRECATED. Each solver accesses a different subset of the database.
  629. optional uint32 rand_skip = 7 [default = 0];
  630. optional DB backend = 8 [default = LEVELDB];
  631. // DEPRECATED. See TransformationParameter. For data pre-processing, we can do
  632. // simple scaling and subtracting the data mean, if provided. Note that the
  633. // mean subtraction is always carried out before scaling.
  634. optional float scale = 2 [default = 1];
  635. optional string mean_file = 3;
  636. // DEPRECATED. See TransformationParameter. Specify if we would like to randomly
  637. // crop an image.
  638. optional uint32 crop_size = 5 [default = 0];
  639. // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
  640. // data.
  641. optional bool mirror = 6 [default = false];
  642. // Force the encoded image to have 3 color channels
  643. optional bool force_encoded_color = 9 [default = false];
  644. // Prefetch queue (Number of batches to prefetch to host memory, increase if
  645. // data access bandwidth varies).
  646. optional uint32 prefetch = 10 [default = 4];
  647. }
  648. message NonMaximumSuppressionParameter {
  649. // Threshold to be used in nms.
  650. optional float nms_threshold = 1 [default = 0.3];
  651. // Maximum number of results to be kept.
  652. optional int32 top_k = 2;
  653. // Parameter for adaptive nms.
  654. optional float eta = 3 [default = 1.0];
  655. }
  656. message SaveOutputParameter {
  657. // Output directory. If not empty, we will save the results.
  658. optional string output_directory = 1;
  659. // Output name prefix.
  660. optional string output_name_prefix = 2;
  661. // Output format.
  662. // VOC - PASCAL VOC output format.
  663. // COCO - MS COCO output format.
  664. optional string output_format = 3;
  665. // If you want to output results, must also provide the following two files.
  666. // Otherwise, we will ignore saving results.
  667. // label map file.
  668. optional string label_map_file = 4;
  669. // A file which contains a list of names and sizes with same order
  670. // of the input DB. The file is in the following format:
  671. // name height width
  672. // ...
  673. optional string name_size_file = 5;
  674. // Number of test images. It can be less than the lines specified in
  675. // name_size_file. For example, when we only want to evaluate on part
  676. // of the test images.
  677. optional uint32 num_test_image = 6;
  678. // The resize parameter used in saving the data.
  679. optional ResizeParameter resize_param = 7;
  680. }
  681. // Message that store parameters used by DetectionOutputLayer
  682. message DetectionOutputParameter {
  683. // Number of classes to be predicted. Required!
  684. optional uint32 num_classes = 1;
  685. // If true, bounding box are shared among different classes.
  686. optional bool share_location = 2 [default = true];
  687. // Background label id. If there is no background class,
  688. // set it as -1.
  689. optional int32 background_label_id = 3 [default = 0];
  690. // Parameters used for non maximum suppression.
  691. optional NonMaximumSuppressionParameter nms_param = 4;
  692. // Parameters used for saving detection results.
  693. optional SaveOutputParameter save_output_param = 5;
  694. // Type of coding method for bbox.
  695. optional PriorBoxParameter.CodeType code_type = 6 [default = CORNER];
  696. // If true, variance is encoded in target; otherwise we need to adjust the
  697. // predicted offset accordingly.
  698. optional bool variance_encoded_in_target = 8 [default = false];
  699. // Number of total bboxes to be kept per image after nms step.
  700. // -1 means keeping all bboxes after nms step.
  701. optional int32 keep_top_k = 7 [default = -1];
  702. // Only consider detections whose confidences are larger than a threshold.
  703. // If not provided, consider all boxes.
  704. optional float confidence_threshold = 9;
  705. // If true, visualize the detection results.
  706. optional bool visualize = 10 [default = false];
  707. // The threshold used to visualize the detection results.
  708. optional float visualize_threshold = 11;
  709. // If provided, save outputs to video file.
  710. optional string save_file = 12;
  711. }
  712. message YoloDetectionOutputParameter {
  713. // Yolo detection output layer
  714. optional uint32 side = 1 [default = 13];
  715. optional uint32 num_classes = 2 [default = 20];
  716. optional uint32 num_box = 3 [default = 5];
  717. optional uint32 coords = 4 [default = 4];
  718. optional float confidence_threshold = 5 [default = 0.01];
  719. optional float nms_threshold = 6 [default = 0.45];
  720. repeated float biases = 7;
  721. optional string label_map_file = 8;
  722. }
  723. message Yolov3DetectionOutputParameter {
  724. // Yolov3 detection output layer
  725. // Yolo detection output layer
  726. optional uint32 num_classes = 1 [default = 20];
  727. optional uint32 num_box = 2 [default = 3];
  728. optional float confidence_threshold = 3 [default = 0.01];
  729. optional float nms_threshold = 4 [default = 0.45];
  730. repeated float biases = 5;
  731. repeated uint32 anchors_scale = 6 ;
  732. optional uint32 mask_group_num = 7 [default = 2];
  733. repeated uint32 mask = 8;
  734. }
  735. message DropoutParameter {
  736. optional float dropout_ratio = 1 [default = 0.5]; // dropout ratio
  737. optional bool scale_train = 2 [default = true]; // scale train or test phase
  738. }
  739. // DummyDataLayer fills any number of arbitrarily shaped blobs with random
  740. // (or constant) data generated by "Fillers" (see "message FillerParameter").
  741. message DummyDataParameter {
  742. // This layer produces N >= 1 top blobs. DummyDataParameter must specify 1 or N
  743. // shape fields, and 0, 1 or N data_fillers.
  744. //
  745. // If 0 data_fillers are specified, ConstantFiller with a value of 0 is used.
  746. // If 1 data_filler is specified, it is applied to all top blobs. If N are
  747. // specified, the ith is applied to the ith top blob.
  748. repeated FillerParameter data_filler = 1;
  749. repeated BlobShape shape = 6;
  750. // 4D dimensions -- deprecated. Use "shape" instead.
  751. repeated uint32 num = 2;
  752. repeated uint32 channels = 3;
  753. repeated uint32 height = 4;
  754. repeated uint32 width = 5;
  755. }
  756. message EltwiseParameter {
  757. enum EltwiseOp {
  758. PROD = 0;
  759. SUM = 1;
  760. MAX = 2;
  761. }
  762. optional EltwiseOp operation = 1 [default = SUM]; // element-wise operation
  763. repeated float coeff = 2; // blob-wise coefficient for SUM operation
  764. // Whether to use an asymptotically slower (for >2 inputs) but stabler method
  765. // of computing the gradient for the PROD operation. (No effect for SUM op.)
  766. optional bool stable_prod_grad = 3 [default = true];
  767. }
  768. // Message that stores parameters used by ELULayer
  769. message ELUParameter {
  770. // Described in:
  771. // Clevert, D.-A., Unterthiner, T., & Hochreiter, S. (2015). Fast and Accurate
  772. // Deep Network Learning by Exponential Linear Units (ELUs). arXiv
  773. optional float alpha = 1 [default = 1];
  774. }
  775. // Message that stores parameters used by EmbedLayer
  776. message EmbedParameter {
  777. optional uint32 num_output = 1; // The number of outputs for the layer
  778. // The input is given as integers to be interpreted as one-hot
  779. // vector indices with dimension num_input. Hence num_input should be
  780. // 1 greater than the maximum possible input value.
  781. optional uint32 input_dim = 2;
  782. optional bool bias_term = 3 [default = true]; // Whether to use a bias term
  783. optional FillerParameter weight_filler = 4; // The filler for the weight
  784. optional FillerParameter bias_filler = 5; // The filler for the bias
  785. }
  786. // Message that stores parameters used by ExpLayer
  787. message ExpParameter {
  788. // ExpLayer computes outputs y = base ^ (shift + scale * x), for base > 0.
  789. // Or if base is set to the default (-1), base is set to e,
  790. // so y = exp(shift + scale * x).
  791. optional float base = 1 [default = -1.0];
  792. optional float scale = 2 [default = 1.0];
  793. optional float shift = 3 [default = 0.0];
  794. }
  795. /// Message that stores parameters used by FlattenLayer
  796. message FlattenParameter {
  797. // The first axis to flatten: all preceding axes are retained in the output.
  798. // May be negative to index from the end (e.g., -1 for the last axis).
  799. optional int32 axis = 1 [default = 1];
  800. // The last axis to flatten: all following axes are retained in the output.
  801. // May be negative to index from the end (e.g., the default -1 for the last
  802. // axis).
  803. optional int32 end_axis = 2 [default = -1];
  804. }
  805. // Message that stores parameters used by HDF5DataLayer
  806. message HDF5DataParameter {
  807. // Specify the data source.
  808. optional string source = 1;
  809. // Specify the batch size.
  810. optional uint32 batch_size = 2;
  811. // Specify whether to shuffle the data.
  812. // If shuffle == true, the ordering of the HDF5 files is shuffled,
  813. // and the ordering of data within any given HDF5 file is shuffled,
  814. // but data between different files are not interleaved; all of a file's
  815. // data are output (in a random order) before moving onto another file.
  816. optional bool shuffle = 3 [default = false];
  817. }
  818. message HDF5OutputParameter {
  819. optional string file_name = 1;
  820. }
  821. message HingeLossParameter {
  822. enum Norm {
  823. L1 = 1;
  824. L2 = 2;
  825. }
  826. // Specify the Norm to use L1 or L2
  827. optional Norm norm = 1 [default = L1];
  828. }
  829. message ImageDataParameter {
  830. // Specify the data source.
  831. optional string source = 1;
  832. // Specify the batch size.
  833. optional uint32 batch_size = 4 [default = 1];
  834. // The rand_skip variable is for the data layer to skip a few data points
  835. // to avoid all asynchronous sgd clients to start at the same point. The skip
  836. // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  837. // be larger than the number of keys in the database.
  838. optional uint32 rand_skip = 7 [default = 0];
  839. // Whether or not ImageLayer should shuffle the list of files at every epoch.
  840. optional bool shuffle = 8 [default = false];
  841. // It will also resize images if new_height or new_width are not zero.
  842. optional uint32 new_height = 9 [default = 0];
  843. optional uint32 new_width = 10 [default = 0];
  844. // Specify if the images are color or gray
  845. optional bool is_color = 11 [default = true];
  846. // DEPRECATED. See TransformationParameter. For data pre-processing, we can do
  847. // simple scaling and subtracting the data mean, if provided. Note that the
  848. // mean subtraction is always carried out before scaling.
  849. optional float scale = 2 [default = 1];
  850. optional string mean_file = 3;
  851. // DEPRECATED. See TransformationParameter. Specify if we would like to randomly
  852. // crop an image.
  853. optional uint32 crop_size = 5 [default = 0];
  854. // DEPRECATED. See TransformationParameter. Specify if we want to randomly mirror
  855. // data.
  856. optional bool mirror = 6 [default = false];
  857. optional string root_folder = 12 [default = ""];
  858. }
  859. message InfogainLossParameter {
  860. // Specify the infogain matrix source.
  861. optional string source = 1;
  862. }
  863. message InnerProductParameter {
  864. optional uint32 num_output = 1; // The number of outputs for the layer
  865. optional bool bias_term = 2 [default = true]; // whether to have bias terms
  866. optional FillerParameter weight_filler = 3; // The filler for the weight
  867. optional FillerParameter bias_filler = 4; // The filler for the bias
  868. // The first axis to be lumped into a single inner product computation;
  869. // all preceding axes are retained in the output.
  870. // May be negative to index from the end (e.g., -1 for the last axis).
  871. optional int32 axis = 5 [default = 1];
  872. // Specify whether to transpose the weight matrix or not.
  873. // If transpose == true, any operations will be performed on the transpose
  874. // of the weight matrix. The weight matrix itself is not going to be transposed
  875. // but rather the transfer flag of operations will be toggled accordingly.
  876. optional bool transpose = 6 [default = false];
  877. }
  878. message InputParameter {
  879. // This layer produces N >= 1 top blob(s) to be assigned manually.
  880. // Define N shapes to set a shape for each top.
  881. // Define 1 shape to set the same shape for every top.
  882. // Define no shape to defer to reshaping manually.
  883. repeated BlobShape shape = 1;
  884. }
  885. message InterpParameter {
  886. optional int32 height = 1 [default = 0]; // Height of output
  887. optional int32 width = 2 [default = 0]; // Width of output
  888. optional int32 zoom_factor = 3 [default = 1]; // zoom factor
  889. optional int32 shrink_factor = 4 [default = 1]; // shrink factor
  890. optional int32 pad_beg = 5 [default = 0]; // padding at begin of input
  891. optional int32 pad_end = 6 [default = 0]; // padding at end of input
  892. }
  893. // Message that stores parameters used by LogLayer
  894. message LogParameter {
  895. // LogLayer computes outputs y = log_base(shift + scale * x), for base > 0.
  896. // Or if base is set to the default (-1), base is set to e,
  897. // so y = ln(shift + scale * x) = log_e(shift + scale * x)
  898. optional float base = 1 [default = -1.0];
  899. optional float scale = 2 [default = 1.0];
  900. optional float shift = 3 [default = 0.0];
  901. }
  902. // Message that stores parameters used by LRNLayer
  903. message LRNParameter {
  904. optional uint32 local_size = 1 [default = 5];
  905. optional float alpha = 2 [default = 1.];
  906. optional float beta = 3 [default = 0.75];
  907. enum NormRegion {
  908. ACROSS_CHANNELS = 0;
  909. WITHIN_CHANNEL = 1;
  910. }
  911. optional NormRegion norm_region = 4 [default = ACROSS_CHANNELS];
  912. optional float k = 5 [default = 1.];
  913. enum Engine {
  914. DEFAULT = 0;
  915. CAFFE = 1;
  916. CUDNN = 2;
  917. }
  918. optional Engine engine = 6 [default = DEFAULT];
  919. }
  920. message MemoryDataParameter {
  921. optional uint32 batch_size = 1;
  922. optional uint32 channels = 2;
  923. optional uint32 height = 3;
  924. optional uint32 width = 4;
  925. }
  926. message MVNParameter {
  927. // This parameter can be set to false to normalize mean only
  928. optional bool normalize_variance = 1 [default = true];
  929. // This parameter can be set to true to perform DNN-like MVN
  930. optional bool across_channels = 2 [default = false];
  931. // Epsilon for not dividing by zero while normalizing variance
  932. optional float eps = 3 [default = 1e-9];
  933. }
  934. // Message that stores parameters used by NormalizeLayer
  935. message NormalizeParameter {
  936. optional bool across_spatial = 1 [default = true];
  937. // Initial value of scale. Default is 1.0 for all
  938. optional FillerParameter scale_filler = 2;
  939. // Whether or not scale parameters are shared across channels.
  940. optional bool channel_shared = 3 [default = true];
  941. // Epsilon for not dividing by zero while normalizing variance
  942. optional float eps = 4 [default = 1e-10];
  943. }
  944. message PermuteParameter {
  945. // The new orders of the axes of data. Notice it should be with
  946. // in the same range as the input data, and it starts from 0.
  947. // Do not provide repeated order.
  948. repeated uint32 order = 1;
  949. }
  950. message PoolingParameter {
  951. enum PoolMethod {
  952. MAX = 0;
  953. AVE = 1;
  954. STOCHASTIC = 2;
  955. }
  956. optional PoolMethod pool = 1 [default = MAX]; // The pooling method
  957. // Pad, kernel size, and stride are all given as a single value for equal
  958. // dimensions in height and width or as Y, X pairs.
  959. optional uint32 pad = 4 [default = 0]; // The padding size (equal in Y, X)
  960. optional uint32 pad_h = 9 [default = 0]; // The padding height
  961. optional uint32 pad_w = 10 [default = 0]; // The padding width
  962. optional uint32 kernel_size = 2; // The kernel size (square)
  963. optional uint32 kernel_h = 5; // The kernel height
  964. optional uint32 kernel_w = 6; // The kernel width
  965. optional uint32 stride = 3 [default = 1]; // The stride (equal in Y, X)
  966. optional uint32 stride_h = 7; // The stride height
  967. optional uint32 stride_w = 8; // The stride width
  968. enum Engine {
  969. DEFAULT = 0;
  970. CAFFE = 1;
  971. CUDNN = 2;
  972. }
  973. optional Engine engine = 11 [default = DEFAULT];
  974. // If global_pooling then it will pool over the size of the bottom by doing
  975. // kernel_h = bottom->height and kernel_w = bottom->width
  976. optional bool global_pooling = 12 [default = false];
  977. }
  978. message PowerParameter {
  979. // PowerLayer computes outputs y = (shift + scale * x) ^ power.
  980. optional float power = 1 [default = 1.0];
  981. optional float scale = 2 [default = 1.0];
  982. optional float shift = 3 [default = 0.0];
  983. }
  984. // Message that store parameters used by PriorBoxLayer
  985. message PriorBoxParameter {
  986. // Encode/decode type.
  987. enum CodeType {
  988. CORNER = 1;
  989. CENTER_SIZE = 2;
  990. CORNER_SIZE = 3;
  991. }
  992. // Minimum box size (in pixels). Required!
  993. repeated float min_size = 1;
  994. // Maximum box size (in pixels). Required!
  995. repeated float max_size = 2;
  996. // Various of aspect ratios. Duplicate ratios will be ignored.
  997. // If none is provided, we use default ratio 1.
  998. repeated float aspect_ratio = 3;
  999. // If true, will flip each aspect ratio.
  1000. // For example, if there is aspect ratio "r",
  1001. // we will generate aspect ratio "1.0/r" as well.
  1002. optional bool flip = 4 [default = true];
  1003. // If true, will clip the prior so that it is within [0, 1]
  1004. optional bool clip = 5 [default = false];
  1005. // Variance for adjusting the prior bboxes.
  1006. repeated float variance = 6;
  1007. // By default, we calculate img_height, img_width, step_x, step_y based on
  1008. // bottom[0] (feat) and bottom[1] (img). Unless these values are explicitely
  1009. // provided.
  1010. // Explicitly provide the img_size.
  1011. optional uint32 img_size = 7;
  1012. // Either img_size or img_h/img_w should be specified; not both.
  1013. optional uint32 img_h = 8;
  1014. optional uint32 img_w = 9;
  1015. // Explicitly provide the step size.
  1016. optional float step = 10;
  1017. // Either step or step_h/step_w should be specified; not both.
  1018. optional float step_h = 11;
  1019. optional float step_w = 12;
  1020. // Offset to the top left corner of each cell.
  1021. optional float offset = 13 [default = 0.5];
  1022. }
  1023. message PSROIPoolingParameter {
  1024. required float spatial_scale = 1;
  1025. required int32 output_dim = 2; // output channel number
  1026. required int32 group_size = 3; // number of groups to encode position-sensitive score maps
  1027. }
  1028. message PythonParameter {
  1029. optional string module = 1;
  1030. optional string layer = 2;
  1031. // This value is set to the attribute `param_str` of the `PythonLayer` object
  1032. // in Python before calling the `setup()` method. This could be a number,
  1033. // string, dictionary in Python dict format, JSON, etc. You may parse this
  1034. // string in `setup` method and use it in `forward` and `backward`.
  1035. optional string param_str = 3 [default = ''];
  1036. // Whether this PythonLayer is shared among worker solvers during data parallelism.
  1037. // If true, each worker solver sequentially run forward from this layer.
  1038. // This value should be set true if you are using it as a data layer.
  1039. optional bool share_in_parallel = 4 [default = false];
  1040. }
  1041. // Message that stores parameters used by RecurrentLayer
  1042. message RecurrentParameter {
  1043. // The dimension of the output (and usually hidden state) representation --
  1044. // must be explicitly set to non-zero.
  1045. optional uint32 num_output = 1 [default = 0];
  1046. optional FillerParameter weight_filler = 2; // The filler for the weight
  1047. optional FillerParameter bias_filler = 3; // The filler for the bias
  1048. // Whether to enable displaying debug_info in the unrolled recurrent net.
  1049. optional bool debug_info = 4 [default = false];
  1050. // Whether to add as additional inputs (bottoms) the initial hidden state
  1051. // blobs, and add as additional outputs (tops) the final timestep hidden state
  1052. // blobs. The number of additional bottom/top blobs required depends on the
  1053. // recurrent architecture -- e.g., 1 for RNNs, 2 for LSTMs.
  1054. optional bool expose_hidden = 5 [default = false];
  1055. }
  1056. // Message that stores parameters used by ReductionLayer
  1057. message ReductionParameter {
  1058. enum ReductionOp {
  1059. SUM = 1;
  1060. ASUM = 2;
  1061. SUMSQ = 3;
  1062. MEAN = 4;
  1063. }
  1064. optional ReductionOp operation = 1 [default = SUM]; // reduction operation
  1065. // The first axis to reduce to a scalar -- may be negative to index from the
  1066. // end (e.g., -1 for the last axis).
  1067. // (Currently, only reduction along ALL "tail" axes is supported; reduction
  1068. // of axis M through N, where N < num_axes - 1, is unsupported.)
  1069. // Suppose we have an n-axis bottom Blob with shape:
  1070. // (d0, d1, d2, ..., d(m-1), dm, d(m+1), ..., d(n-1)).
  1071. // If axis == m, the output Blob will have shape
  1072. // (d0, d1, d2, ..., d(m-1)),
  1073. // and the ReductionOp operation is performed (d0 * d1 * d2 * ... * d(m-1))
  1074. // times, each including (dm * d(m+1) * ... * d(n-1)) individual data.
  1075. // If axis == 0 (the default), the output Blob always has the empty shape
  1076. // (count 1), performing reduction across the entire input --
  1077. // often useful for creating new loss functions.
  1078. optional int32 axis = 2 [default = 0];
  1079. optional float coeff = 3 [default = 1.0]; // coefficient for output
  1080. }
  1081. // Message that stores parameters used by ReLULayer
  1082. message ReLUParameter {
  1083. // Allow non-zero slope for negative inputs to speed up optimization
  1084. // Described in:
  1085. // Maas, A. L., Hannun, A. Y., & Ng, A. Y. (2013). Rectifier nonlinearities
  1086. // improve neural network acoustic models. In ICML Workshop on Deep Learning
  1087. // for Audio, Speech, and Language Processing.
  1088. optional float negative_slope = 1 [default = 0];
  1089. enum Engine {
  1090. DEFAULT = 0;
  1091. CAFFE = 1;
  1092. CUDNN = 2;
  1093. }
  1094. optional Engine engine = 2 [default = DEFAULT];
  1095. }
  1096. message ReorgParameter {
  1097. optional uint32 stride = 1;
  1098. optional bool reverse = 2 [default = false];
  1099. }
  1100. message ReshapeParameter {
  1101. // Specify the output dimensions. If some of the dimensions are set to 0,
  1102. // the corresponding dimension from the bottom layer is used (unchanged).
  1103. // Exactly one dimension may be set to -1, in which case its value is
  1104. // inferred from the count of the bottom blob and the remaining dimensions.
  1105. // For example, suppose we want to reshape a 2D blob "input" with shape 2 x 8:
  1106. //
  1107. // layer {
  1108. // type: "Reshape" bottom: "input" top: "output"
  1109. // reshape_param { ... }
  1110. // }
  1111. //
  1112. // If "input" is 2D with shape 2 x 8, then the following reshape_param
  1113. // specifications are all equivalent, producing a 3D blob "output" with shape
  1114. // 2 x 2 x 4:
  1115. //
  1116. // reshape_param { shape { dim: 2 dim: 2 dim: 4 } }
  1117. // reshape_param { shape { dim: 0 dim: 2 dim: 4 } }
  1118. // reshape_param { shape { dim: 0 dim: 2 dim: -1 } }
  1119. // reshape_param { shape { dim: -1 dim: 0 dim: 2 } }
  1120. //
  1121. optional BlobShape shape = 1;
  1122. // axis and num_axes control the portion of the bottom blob's shape that are
  1123. // replaced by (included in) the reshape. By default (axis == 0 and
  1124. // num_axes == -1), the entire bottom blob shape is included in the reshape,
  1125. // and hence the shape field must specify the entire output shape.
  1126. //
  1127. // axis may be non-zero to retain some portion of the beginning of the input
  1128. // shape (and may be negative to index from the end; e.g., -1 to begin the
  1129. // reshape after the last axis, including nothing in the reshape,
  1130. // -2 to include only the last axis, etc.).
  1131. //
  1132. // For example, suppose "input" is a 2D blob with shape 2 x 8.
  1133. // Then the following ReshapeLayer specifications are all equivalent,
  1134. // producing a blob "output" with shape 2 x 2 x 4:
  1135. //
  1136. // reshape_param { shape { dim: 2 dim: 2 dim: 4 } }
  1137. // reshape_param { shape { dim: 2 dim: 4 } axis: 1 }
  1138. // reshape_param { shape { dim: 2 dim: 4 } axis: -3 }
  1139. //
  1140. // num_axes specifies the extent of the reshape.
  1141. // If num_axes >= 0 (and axis >= 0), the reshape will be performed only on
  1142. // input axes in the range [axis, axis+num_axes].
  1143. // num_axes may also be -1, the default, to include all remaining axes
  1144. // (starting from axis).
  1145. //
  1146. // For example, suppose "input" is a 2D blob with shape 2 x 8.
  1147. // Then the following ReshapeLayer specifications are equivalent,
  1148. // producing a blob "output" with shape 1 x 2 x 8.
  1149. //
  1150. // reshape_param { shape { dim: 1 dim: 2 dim: 8 } }
  1151. // reshape_param { shape { dim: 1 dim: 2 } num_axes: 1 }
  1152. // reshape_param { shape { dim: 1 } num_axes: 0 }
  1153. //
  1154. // On the other hand, these would produce output blob shape 2 x 1 x 8:
  1155. //
  1156. // reshape_param { shape { dim: 2 dim: 1 dim: 8 } }
  1157. // reshape_param { shape { dim: 1 } axis: 1 num_axes: 0 }
  1158. //
  1159. optional int32 axis = 2 [default = 0];
  1160. optional int32 num_axes = 3 [default = -1];
  1161. }
  1162. message ROIAlignParameter {
  1163. // Pad, kernel size, and stride are all given as a single value for equal
  1164. // dimensions in height and width or as Y, X pairs.
  1165. optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
  1166. optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
  1167. // Multiplicative spatial scale factor to translate ROI coords from their
  1168. // input scale to the scale used when pooling
  1169. optional float spatial_scale = 3 [default = 1];
  1170. }
  1171. // Message that stores parameters used by ROIPoolingLayer
  1172. message ROIPoolingParameter {
  1173. // Pad, kernel size, and stride are all given as a single value for equal
  1174. // dimensions in height and width or as Y, X pairs.
  1175. optional uint32 pooled_h = 1 [default = 0]; // The pooled output height
  1176. optional uint32 pooled_w = 2 [default = 0]; // The pooled output width
  1177. // Multiplicative spatial scale factor to translate ROI coords from their
  1178. // input scale to the scale used when pooling
  1179. optional float spatial_scale = 3 [default = 1];
  1180. }
  1181. message ScaleParameter {
  1182. // The first axis of bottom[0] (the first input Blob) along which to apply
  1183. // bottom[1] (the second input Blob). May be negative to index from the end
  1184. // (e.g., -1 for the last axis).
  1185. //
  1186. // For example, if bottom[0] is 4D with shape 100x3x40x60, the output
  1187. // top[0] will have the same shape, and bottom[1] may have any of the
  1188. // following shapes (for the given value of axis):
  1189. // (axis == 0 == -4) 100; 100x3; 100x3x40; 100x3x40x60
  1190. // (axis == 1 == -3) 3; 3x40; 3x40x60
  1191. // (axis == 2 == -2) 40; 40x60
  1192. // (axis == 3 == -1) 60
  1193. // Furthermore, bottom[1] may have the empty shape (regardless of the value of
  1194. // "axis") -- a scalar multiplier.
  1195. optional int32 axis = 1 [default = 1];
  1196. // (num_axes is ignored unless just one bottom is given and the scale is
  1197. // a learned parameter of the layer. Otherwise, num_axes is determined by the
  1198. // number of axes by the second bottom.)
  1199. // The number of axes of the input (bottom[0]) covered by the scale
  1200. // parameter, or -1 to cover all axes of bottom[0] starting from `axis`.
  1201. // Set num_axes := 0, to multiply with a zero-axis Blob: a scalar.
  1202. optional int32 num_axes = 2 [default = 1];
  1203. // (filler is ignored unless just one bottom is given and the scale is
  1204. // a learned parameter of the layer.)
  1205. // The initialization for the learned scale parameter.
  1206. // Default is the unit (1) initialization, resulting in the ScaleLayer
  1207. // initially performing the identity operation.
  1208. optional FillerParameter filler = 3;
  1209. // Whether to also learn a bias (equivalent to a ScaleLayer+BiasLayer, but
  1210. // may be more efficient). Initialized with bias_filler (defaults to 0).
  1211. optional bool bias_term = 4 [default = false];
  1212. optional FillerParameter bias_filler = 5;
  1213. }
  1214. message ShuffleChannelParameter {
  1215. // first introduced by
  1216. // "ShuffleNet: An Extremely Efficient Convolutional Neural Network
  1217. // for Mobile Devices"
  1218. optional uint32 group = 1[default = 1]; // The number of group
  1219. }
  1220. message SigmoidParameter {
  1221. enum Engine {
  1222. DEFAULT = 0;
  1223. CAFFE = 1;
  1224. CUDNN = 2;
  1225. }
  1226. optional Engine engine = 1 [default = DEFAULT];
  1227. }
  1228. message SmoothL1LossParameter {
  1229. // SmoothL1Loss(x) =
  1230. // 0.5 * (sigma * x) ** 2 -- if x < 1.0 / sigma / sigma
  1231. // |x| - 0.5 / sigma / sigma -- otherwise
  1232. optional float sigma = 1 [default = 1];
  1233. }
  1234. message SliceParameter {
  1235. // The axis along which to slice -- may be negative to index from the end
  1236. // (e.g., -1 for the last axis).
  1237. // By default, SliceLayer concatenates blobs along the "channels" axis (1).
  1238. optional int32 axis = 3 [default = 1];
  1239. repeated uint32 slice_point = 2;
  1240. // DEPRECATED: alias for "axis" -- does not support negative indexing.
  1241. optional uint32 slice_dim = 1 [default = 1];
  1242. }
  1243. // Message that stores parameters used by SoftmaxLayer, SoftmaxWithLossLayer
  1244. message SoftmaxParameter {
  1245. enum Engine {
  1246. DEFAULT = 0;
  1247. CAFFE = 1;
  1248. CUDNN = 2;
  1249. }
  1250. optional Engine engine = 1 [default = DEFAULT];
  1251. // The axis along which to perform the softmax -- may be negative to index
  1252. // from the end (e.g., -1 for the last axis).
  1253. // Any other axes will be evaluated as independent softmaxes.
  1254. optional int32 axis = 2 [default = 1];
  1255. }
  1256. message TanHParameter {
  1257. enum Engine {
  1258. DEFAULT = 0;
  1259. CAFFE = 1;
  1260. CUDNN = 2;
  1261. }
  1262. optional Engine engine = 1 [default = DEFAULT];
  1263. }
  1264. // Message that stores parameters used by TileLayer
  1265. message TileParameter {
  1266. // The index of the axis to tile.
  1267. optional int32 axis = 1 [default = 1];
  1268. // The number of copies (tiles) of the blob to output.
  1269. optional int32 tiles = 2;
  1270. }
  1271. // Message that stores parameters used by ThresholdLayer
  1272. message ThresholdParameter {
  1273. optional float threshold = 1 [default = 0]; // Strictly positive values
  1274. }
  1275. message WindowDataParameter {
  1276. // Specify the data source.
  1277. optional string source = 1;
  1278. // For data pre-processing, we can do simple scaling and subtracting the
  1279. // data mean, if provided. Note that the mean subtraction is always carried
  1280. // out before scaling.
  1281. optional float scale = 2 [default = 1];
  1282. optional string mean_file = 3;
  1283. // Specify the batch size.
  1284. optional uint32 batch_size = 4;
  1285. // Specify if we would like to randomly crop an image.
  1286. optional uint32 crop_size = 5 [default = 0];
  1287. // Specify if we want to randomly mirror data.
  1288. optional bool mirror = 6 [default = false];
  1289. // Foreground (object) overlap threshold
  1290. optional float fg_threshold = 7 [default = 0.5];
  1291. // Background (non-object) overlap threshold
  1292. optional float bg_threshold = 8 [default = 0.5];
  1293. // Fraction of batch that should be foreground objects
  1294. optional float fg_fraction = 9 [default = 0.25];
  1295. // Amount of contextual padding to add around a window
  1296. // (used only by the window_data_layer)
  1297. optional uint32 context_pad = 10 [default = 0];
  1298. // Mode for cropping out a detection window
  1299. // warp: cropped window is warped to a fixed size and aspect ratio
  1300. // square: the tightest square around the window is cropped
  1301. optional string crop_mode = 11 [default = "warp"];
  1302. // cache_images: will load all images in memory for faster access
  1303. optional bool cache_images = 12 [default = false];
  1304. // append root_folder to locate images
  1305. optional string root_folder = 13 [default = ""];
  1306. }
  1307. message SPPParameter {
  1308. enum PoolMethod {
  1309. MAX = 0;
  1310. AVE = 1;
  1311. STOCHASTIC = 2;
  1312. }
  1313. optional uint32 pyramid_height = 1;
  1314. optional PoolMethod pool = 2 [default = MAX]; // The pooling method
  1315. enum Engine {
  1316. DEFAULT = 0;
  1317. CAFFE = 1;
  1318. CUDNN = 2;
  1319. }
  1320. optional Engine engine = 6 [default = DEFAULT];
  1321. }
  1322. // DEPRECATED: use LayerParameter.
  1323. message V1LayerParameter {
  1324. repeated string bottom = 2;
  1325. repeated string top = 3;
  1326. optional string name = 4;
  1327. repeated NetStateRule include = 32;
  1328. repeated NetStateRule exclude = 33;
  1329. enum LayerType {
  1330. NONE = 0;
  1331. ABSVAL = 35;
  1332. ACCURACY = 1;
  1333. ARGMAX = 30;
  1334. BNLL = 2;
  1335. CONCAT = 3;
  1336. CONTRASTIVE_LOSS = 37;
  1337. CONVOLUTION = 4;
  1338. DATA = 5;
  1339. DECONVOLUTION = 39;
  1340. DROPOUT = 6;
  1341. DUMMY_DATA = 32;
  1342. EUCLIDEAN_LOSS = 7;
  1343. ELTWISE = 25;
  1344. EXP = 38;
  1345. FLATTEN = 8;
  1346. HDF5_DATA = 9;
  1347. HDF5_OUTPUT = 10;
  1348. HINGE_LOSS = 28;
  1349. IM2COL = 11;
  1350. IMAGE_DATA = 12;
  1351. INFOGAIN_LOSS = 13;
  1352. INNER_PRODUCT = 14;
  1353. LRN = 15;
  1354. MEMORY_DATA = 29;
  1355. MULTINOMIAL_LOGISTIC_LOSS = 16;
  1356. MVN = 34;
  1357. POOLING = 17;
  1358. POWER = 26;
  1359. RELU = 18;
  1360. SIGMOID = 19;
  1361. SIGMOID_CROSS_ENTROPY_LOSS = 27;
  1362. SILENCE = 36;
  1363. SOFTMAX = 20;
  1364. SOFTMAX_LOSS = 21;
  1365. SPLIT = 22;
  1366. SLICE = 33;
  1367. TANH = 23;
  1368. WINDOW_DATA = 24;
  1369. THRESHOLD = 31;
  1370. }
  1371. optional LayerType type = 5;
  1372. repeated BlobProto blobs = 6;
  1373. repeated string param = 1001;
  1374. repeated DimCheckMode blob_share_mode = 1002;
  1375. enum DimCheckMode {
  1376. STRICT = 0;
  1377. PERMISSIVE = 1;
  1378. }
  1379. repeated float blobs_lr = 7;
  1380. repeated float weight_decay = 8;
  1381. repeated float loss_weight = 35;
  1382. optional AccuracyParameter accuracy_param = 27;
  1383. optional ArgMaxParameter argmax_param = 23;
  1384. optional ConcatParameter concat_param = 9;
  1385. optional ContrastiveLossParameter contrastive_loss_param = 40;
  1386. optional ConvolutionParameter convolution_param = 10;
  1387. optional DataParameter data_param = 11;
  1388. optional DropoutParameter dropout_param = 12;
  1389. optional DummyDataParameter dummy_data_param = 26;
  1390. optional EltwiseParameter eltwise_param = 24;
  1391. optional ExpParameter exp_param = 41;
  1392. optional HDF5DataParameter hdf5_data_param = 13;
  1393. optional HDF5OutputParameter hdf5_output_param = 14;
  1394. optional HingeLossParameter hinge_loss_param = 29;
  1395. optional ImageDataParameter image_data_param = 15;
  1396. optional InfogainLossParameter infogain_loss_param = 16;
  1397. optional InnerProductParameter inner_product_param = 17;
  1398. optional LRNParameter lrn_param = 18;
  1399. optional MemoryDataParameter memory_data_param = 22;
  1400. optional MVNParameter mvn_param = 34;
  1401. optional PoolingParameter pooling_param = 19;
  1402. optional PowerParameter power_param = 21;
  1403. optional ReLUParameter relu_param = 30;
  1404. optional SigmoidParameter sigmoid_param = 38;
  1405. optional SoftmaxParameter softmax_param = 39;
  1406. optional SliceParameter slice_param = 31;
  1407. optional TanHParameter tanh_param = 37;
  1408. optional ThresholdParameter threshold_param = 25;
  1409. optional WindowDataParameter window_data_param = 20;
  1410. optional TransformationParameter transform_param = 36;
  1411. optional LossParameter loss_param = 42;
  1412. optional V0LayerParameter layer = 1;
  1413. }
  1414. // DEPRECATED: V0LayerParameter is the old way of specifying layer parameters
  1415. // in Caffe. We keep this message type around for legacy support.
  1416. message V0LayerParameter {
  1417. optional string name = 1; // the layer name
  1418. optional string type = 2; // the string to specify the layer type
  1419. // Parameters to specify layers with inner products.
  1420. optional uint32 num_output = 3; // The number of outputs for the layer
  1421. optional bool biasterm = 4 [default = true]; // whether to have bias terms
  1422. optional FillerParameter weight_filler = 5; // The filler for the weight
  1423. optional FillerParameter bias_filler = 6; // The filler for the bias
  1424. optional uint32 pad = 7 [default = 0]; // The padding size
  1425. optional uint32 kernelsize = 8; // The kernel size
  1426. optional uint32 group = 9 [default = 1]; // The group size for group conv
  1427. optional uint32 stride = 10 [default = 1]; // The stride
  1428. enum PoolMethod {
  1429. MAX = 0;
  1430. AVE = 1;
  1431. STOCHASTIC = 2;
  1432. }
  1433. optional PoolMethod pool = 11 [default = MAX]; // The pooling method
  1434. optional float dropout_ratio = 12 [default = 0.5]; // dropout ratio
  1435. optional uint32 local_size = 13 [default = 5]; // for local response norm
  1436. optional float alpha = 14 [default = 1.]; // for local response norm
  1437. optional float beta = 15 [default = 0.75]; // for local response norm
  1438. optional float k = 22 [default = 1.];
  1439. // For data layers, specify the data source
  1440. optional string source = 16;
  1441. // For data pre-processing, we can do simple scaling and subtracting the
  1442. // data mean, if provided. Note that the mean subtraction is always carried
  1443. // out before scaling.
  1444. optional float scale = 17 [default = 1];
  1445. optional string meanfile = 18;
  1446. // For data layers, specify the batch size.
  1447. optional uint32 batchsize = 19;
  1448. // For data layers, specify if we would like to randomly crop an image.
  1449. optional uint32 cropsize = 20 [default = 0];
  1450. // For data layers, specify if we want to randomly mirror data.
  1451. optional bool mirror = 21 [default = false];
  1452. // The blobs containing the numeric parameters of the layer
  1453. repeated BlobProto blobs = 50;
  1454. // The ratio that is multiplied on the global learning rate. If you want to
  1455. // set the learning ratio for one blob, you need to set it for all blobs.
  1456. repeated float blobs_lr = 51;
  1457. // The weight decay that is multiplied on the global weight decay.
  1458. repeated float weight_decay = 52;
  1459. // The rand_skip variable is for the data layer to skip a few data points
  1460. // to avoid all asynchronous sgd clients to start at the same point. The skip
  1461. // point would be set as rand_skip * rand(0,1). Note that rand_skip should not
  1462. // be larger than the number of keys in the database.
  1463. optional uint32 rand_skip = 53 [default = 0];
  1464. // Fields related to detection (det_*)
  1465. // foreground (object) overlap threshold
  1466. optional float det_fg_threshold = 54 [default = 0.5];
  1467. // background (non-object) overlap threshold
  1468. optional float det_bg_threshold = 55 [default = 0.5];
  1469. // Fraction of batch that should be foreground objects
  1470. optional float det_fg_fraction = 56 [default = 0.25];
  1471. // optional bool OBSOLETE_can_clobber = 57 [default = true];
  1472. // Amount of contextual padding to add around a window
  1473. // (used only by the window_data_layer)
  1474. optional uint32 det_context_pad = 58 [default = 0];
  1475. // Mode for cropping out a detection window
  1476. // warp: cropped window is warped to a fixed size and aspect ratio
  1477. // square: the tightest square around the window is cropped
  1478. optional string det_crop_mode = 59 [default = "warp"];
  1479. // For ReshapeLayer, one needs to specify the new dimensions.
  1480. optional int32 new_num = 60 [default = 0];
  1481. optional int32 new_channels = 61 [default = 0];
  1482. optional int32 new_height = 62 [default = 0];
  1483. optional int32 new_width = 63 [default = 0];
  1484. // Whether or not ImageLayer should shuffle the list of files at every epoch.
  1485. // It will also resize images if new_height or new_width are not zero.
  1486. optional bool shuffle_images = 64 [default = false];
  1487. // For ConcatLayer, one needs to specify the dimension for concatenation, and
  1488. // the other dimensions must be the same for all the bottom blobs.
  1489. // By default it will concatenate blobs along the channels dimension.
  1490. optional uint32 concat_dim = 65 [default = 1];
  1491. optional HDF5OutputParameter hdf5_output_param = 1001;
  1492. }
  1493. message PReLUParameter {
  1494. // Parametric ReLU described in K. He et al, Delving Deep into Rectifiers:
  1495. // Surpassing Human-Level Performance on ImageNet Classification, 2015.
  1496. // Initial value of a_i. Default is a_i=0.25 for all i.
  1497. optional FillerParameter filler = 1;
  1498. // Whether or not slope paramters are shared across channels.
  1499. optional bool channel_shared = 2 [default = false];
  1500. }