]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - jacinto-ai/caffe-jacinto.git/blob - src/caffe/proto/caffe.proto
c3140708d93f84bd42ee91f3ad5968ff4274fc5f
[jacinto-ai/caffe-jacinto.git] / src / caffe / proto / caffe.proto
1 // Copyright 2013 Yangqing Jia
3 package caffe;
5 message BlobProto {
6   optional int32 num = 1 [default = 0];
7   optional int32 channels = 2 [default = 0];
8   optional int32 height = 3 [default = 0];
9   optional int32 width = 4 [default = 0];
10   repeated float data = 5 [packed=true];
11   repeated float diff = 6 [packed=true];
12 }
14 message Datum {
15   optional int32 channels = 1;
16   optional int32 height = 2;
17   optional int32 width = 3;
18   // the actual image data, in bytes
19   optional bytes data = 4;
20   optional int32 label = 5;
21   // Optionally, the datum could also hold float data.
22   repeated float float_data = 6;
23 }
25 message FillerParameter {
26   // The filler type.
27   optional string type = 1 [default = 'constant'];
28   optional float value = 2 [default = 0]; // the value in constant filler
29   optional float min = 3 [default = 0]; // the min value in uniform filler
30   optional float max = 4 [default = 1]; // the max value in uniform filler
31   optional float mean = 5 [default = 0]; // the mean value in gaussian filler
32   optional float std = 6 [default = 1]; // the std value in gaussian filler
33 }
35 message LayerParameter {
36   optional string name = 1; // the layer name
37   optional string type = 2; // the string to specify the layer type
39   // Parameters to specify layers with inner products.
40   optional uint32 num_output = 3; // The number of outputs for the layer
41   optional bool biasterm = 4 [default = true]; // whether to have bias terms
42   optional FillerParameter weight_filler = 5; // The filler for the weight
43   optional FillerParameter bias_filler = 6; // The filler for the bias
45   optional uint32 pad = 7 [default = 0]; // The padding size
46   optional uint32 kernelsize = 8; // The kernel size
47   optional uint32 group = 9 [default = 1]; // The group size for group conv
48   optional uint32 stride = 10 [default = 1]; // The stride
49   enum PoolMethod {
50     MAX = 0;
51     AVE = 1;
52     STOCHASTIC = 2;
53   }
54   optional PoolMethod pool = 11 [default = MAX]; // The pooling method
55   optional float dropout_ratio = 12 [default = 0.5]; // dropout ratio
57   optional uint32 local_size = 13 [default = 5]; // for local response norm
58   optional float alpha = 14 [default = 1.]; // for local response norm
59   optional float beta = 15 [default = 0.75]; // for local response norm
61   // For data layers, specify the data source
62   optional string source = 16;
63   // For data pre-processing, we can do simple scaling and subtracting the
64   // data mean, if provided. Note that the mean subtraction is always carried
65   // out before scaling.
66   optional float scale = 17 [ default = 1 ];
67   optional string meanfile = 18;
68   // For data layers, specify the batch size.
69   optional uint32 batchsize = 19;
70   // For data layers, specify if we would like to randomly crop an image.
71   optional uint32 cropsize = 20 [default = 0];
72   // For data layers, specify if we want to randomly mirror data.
73   optional bool mirror = 21 [default = false];
75   // The blobs containing the numeric parameters of the layer
76   repeated BlobProto blobs = 50;
77   // The ratio that is multiplied on the global learning rate. If you want to set
78   // the learning ratio for one blob, you need to set it for all blobs.
79   repeated float blobs_lr = 51;
80   // The weight decay that is multiplied on the global weight decay.
81   repeated float weight_decay = 52;
82 }
84 message LayerConnection {
85   optional LayerParameter layer = 1; // the layer parameter
86   repeated string bottom = 2; // the name of the bottom blobs
87   repeated string top = 3; // the name of the top blobs
88 }
90 message NetParameter {
91   optional string name = 1; // consider giving the network a name
92   repeated LayerConnection layers = 2; // a bunch of layers.
93   repeated string input = 3; // The input to the network
94 }
96 message SolverParameter {
97   optional string train_net = 1; // The proto file for the training net.
98   optional string test_net = 2; // The proto file for the testing net.
99   // The number of iterations for each testing phase.
100   optional int32 test_iter = 3 [ default = 0 ];
101   // The number of iterations between two testing phases.
102   optional int32 test_interval = 4 [ default = 0 ];
103   optional float base_lr = 5; // The base learning rate
104   // the number of iterations between displaying info. If display = 0, no info
105   // will be displayed.
106   optional int32 display = 6;
107   optional int32 max_iter = 7; // the maximum number of iterations
108   optional string lr_policy = 8; // The learning rate decay policy.
109   optional float gamma = 9; // The parameter to compute the learning rate.
110   optional float power = 10; // The parameter to compute the learning rate.
111   optional float momentum = 11; // The momentum value.
112   optional float weight_decay = 12; // The weight decay.
113   optional int32 stepsize = 13; // the stepsize for learning rate policy "step"
114   optional int32 snapshot = 14 [default = 0]; // The snapshot interval
115   optional string snapshot_prefix = 15; // The prefix for the snapshot.
116   // whether to snapshot diff in the results or not. Snapshotting diff will help
117   // debugging but the final protocol buffer size will be much larger.
118   optional bool snapshot_diff = 16 [ default = false];
121 // A message that stores the solver snapshots
122 message SolverState {
123   optional int32 iter = 1; // The current iteration
124   optional string learned_net = 2; // The file that stores the learned net.
125   repeated BlobProto history = 3; // The history for sgd solvers