Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 1 | // |
| 2 | // Copyright © 2017 Arm Ltd. All rights reserved. |
| 3 | // SPDX-License-Identifier: MIT |
| 4 | // |
| 5 | |
Derek Lamberti | 0028d1b | 2019-02-20 13:57:42 +0000 | [diff] [blame] | 6 | namespace armnnSerializer; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 7 | |
| 8 | file_identifier "ARMN"; |
| 9 | |
| 10 | file_extension "armnn"; |
| 11 | |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 12 | enum ActivationFunction : byte { |
| 13 | Sigmoid = 0, |
| 14 | TanH = 1, |
| 15 | Linear = 2, |
| 16 | ReLu = 3, |
| 17 | BoundedReLu = 4, |
| 18 | SoftReLu = 5, |
| 19 | LeakyReLu = 6, |
| 20 | Abs = 7, |
| 21 | Sqrt = 8, |
| 22 | Square = 9 |
| 23 | } |
| 24 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 25 | enum DataType : byte { |
| 26 | Float16 = 0, |
| 27 | Float32 = 1, |
| 28 | QuantisedAsymm8 = 2, |
| 29 | Signed32 = 3, |
Nattapat Chaimanowong | cd5ac23 | 2019-03-19 12:26:36 +0000 | [diff] [blame] | 30 | Boolean = 4, |
| 31 | QuantisedSymm16 = 5 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 32 | } |
| 33 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 34 | enum DataLayout : byte { |
| 35 | NHWC = 0, |
| 36 | NCHW = 1 |
| 37 | } |
| 38 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 39 | table TensorInfo { |
| 40 | dimensions:[uint]; |
| 41 | dataType:DataType; |
| 42 | quantizationScale:float = 1.0; |
| 43 | quantizationOffset:int = 0; |
| 44 | } |
| 45 | |
| 46 | struct Connection { |
| 47 | sourceLayerIndex:uint; |
| 48 | outputSlotIndex:uint; |
| 49 | } |
| 50 | |
| 51 | table ByteData { |
| 52 | data:[byte]; |
| 53 | } |
| 54 | |
| 55 | table ShortData { |
| 56 | data:[short]; |
| 57 | } |
| 58 | |
| 59 | table IntData { |
| 60 | data:[int]; |
| 61 | } |
| 62 | |
| 63 | table LongData { |
| 64 | data:[long]; |
| 65 | } |
| 66 | |
| 67 | union ConstTensorData { ByteData, ShortData, IntData, LongData } |
| 68 | |
| 69 | table ConstTensor { |
| 70 | info:TensorInfo; |
| 71 | data:ConstTensorData; |
| 72 | } |
| 73 | |
| 74 | table InputSlot { |
| 75 | index:uint; |
| 76 | connection:Connection; |
| 77 | } |
| 78 | |
| 79 | table OutputSlot { |
| 80 | index:uint; |
| 81 | tensorInfo:TensorInfo; |
| 82 | } |
| 83 | |
| 84 | enum LayerType : uint { |
| 85 | Addition = 0, |
| 86 | Input = 1, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 87 | Multiplication = 2, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 88 | Output = 3, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 89 | Pooling2d = 4, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 90 | Reshape = 5, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 91 | Softmax = 6, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 92 | Convolution2d = 7, |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 93 | DepthwiseConvolution2d = 8, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 94 | Activation = 9, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 95 | Permute = 10, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 96 | FullyConnected = 11, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 97 | Constant = 12, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 98 | SpaceToBatchNd = 13, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 99 | BatchToSpaceNd = 14, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 100 | Division = 15, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 101 | Minimum = 16, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 102 | Equal = 17, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 103 | Maximum = 18, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 104 | Normalization = 19, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 105 | Pad = 20, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 106 | Rsqrt = 21, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 107 | Floor = 22, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 108 | BatchNormalization = 23, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 109 | Greater = 24, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 110 | ResizeBilinear = 25, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 111 | Subtraction = 26, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 112 | StridedSlice = 27, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 113 | Gather = 28, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 114 | Mean = 29, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 115 | Merger = 30, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 116 | L2Normalization = 31, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 117 | Splitter = 32, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 118 | DetectionPostProcess = 33, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 119 | Lstm = 34, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 120 | Quantize = 35, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 121 | Dequantize = 36, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 122 | Merge = 37, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame^] | 123 | Switch = 38, |
| 124 | Concat = 39 |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 125 | } |
| 126 | |
| 127 | // Base layer table to be used as part of other layers |
| 128 | table LayerBase { |
| 129 | index:uint; |
| 130 | layerName:string; |
| 131 | layerType:LayerType; |
| 132 | inputSlots:[InputSlot]; |
| 133 | outputSlots:[OutputSlot]; |
| 134 | } |
| 135 | |
| 136 | table BindableLayerBase { |
| 137 | base:LayerBase; |
| 138 | layerBindingId:int; |
| 139 | } |
| 140 | |
| 141 | // Table for each layer defined below |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 142 | table ActivationLayer { |
| 143 | base:LayerBase; |
| 144 | descriptor:ActivationDescriptor; |
| 145 | } |
| 146 | |
| 147 | table ActivationDescriptor { |
| 148 | function:ActivationFunction = Sigmoid; |
| 149 | a:float; |
| 150 | b:float; |
| 151 | } |
| 152 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 153 | table AdditionLayer { |
| 154 | base:LayerBase; |
| 155 | } |
| 156 | |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 157 | table ConstantLayer { |
| 158 | base:LayerBase; |
| 159 | input:ConstTensor; |
| 160 | } |
| 161 | |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 162 | table Convolution2dLayer { |
| 163 | base:LayerBase; |
| 164 | descriptor:Convolution2dDescriptor; |
| 165 | weights:ConstTensor; |
| 166 | biases:ConstTensor; |
| 167 | } |
| 168 | |
| 169 | table Convolution2dDescriptor { |
| 170 | padLeft:uint; |
| 171 | padRight:uint; |
| 172 | padTop:uint; |
| 173 | padBottom:uint; |
| 174 | strideX:uint; |
| 175 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 176 | dilationX:uint = 1; |
| 177 | dilationY:uint = 1; |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 178 | biasEnabled:bool = false; |
| 179 | dataLayout:DataLayout = NCHW; |
| 180 | } |
| 181 | |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 182 | table DivisionLayer { |
| 183 | base:LayerBase; |
| 184 | } |
| 185 | |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 186 | table EqualLayer { |
| 187 | base:LayerBase; |
| 188 | } |
| 189 | |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 190 | table FloorLayer{ |
| 191 | base:LayerBase; |
| 192 | } |
| 193 | |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 194 | table FullyConnectedLayer { |
| 195 | base:LayerBase; |
| 196 | descriptor:FullyConnectedDescriptor; |
| 197 | weights:ConstTensor; |
| 198 | biases:ConstTensor; |
| 199 | } |
| 200 | |
| 201 | table FullyConnectedDescriptor { |
| 202 | biasEnabled:bool = false; |
| 203 | transposeWeightsMatrix:bool = false; |
| 204 | } |
| 205 | |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 206 | table GatherLayer { |
| 207 | base:LayerBase; |
| 208 | } |
| 209 | |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 210 | table GreaterLayer { |
| 211 | base:LayerBase; |
| 212 | } |
| 213 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 214 | table InputLayer { |
| 215 | base:BindableLayerBase; |
| 216 | } |
| 217 | |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 218 | table L2NormalizationLayer { |
| 219 | base:LayerBase; |
| 220 | descriptor:L2NormalizationDescriptor; |
| 221 | } |
| 222 | |
| 223 | table L2NormalizationDescriptor { |
| 224 | dataLayout:DataLayout = NCHW; |
| 225 | } |
| 226 | |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 227 | table MinimumLayer { |
| 228 | base:LayerBase; |
| 229 | } |
| 230 | |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 231 | table MaximumLayer { |
| 232 | base:LayerBase; |
| 233 | } |
| 234 | |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 235 | table MultiplicationLayer { |
| 236 | base:LayerBase; |
| 237 | } |
| 238 | |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 239 | table Pooling2dLayer { |
| 240 | base:LayerBase; |
| 241 | descriptor:Pooling2dDescriptor; |
| 242 | } |
| 243 | |
| 244 | enum PoolingAlgorithm : byte { |
| 245 | Max = 0, |
| 246 | Average = 1, |
| 247 | L2 = 2 |
| 248 | } |
| 249 | |
| 250 | enum OutputShapeRounding : byte { |
| 251 | Floor = 0, |
| 252 | Ceiling = 1 |
| 253 | } |
| 254 | |
| 255 | enum PaddingMethod : byte { |
| 256 | IgnoreValue = 0, |
| 257 | Exclude = 1 |
| 258 | } |
| 259 | |
| 260 | table Pooling2dDescriptor { |
| 261 | poolType:PoolingAlgorithm; |
| 262 | padLeft:uint; |
| 263 | padRight:uint; |
| 264 | padTop:uint; |
| 265 | padBottom:uint; |
| 266 | poolWidth:uint; |
| 267 | poolHeight:uint; |
| 268 | strideX:uint; |
| 269 | strideY:uint; |
| 270 | outputShapeRounding:OutputShapeRounding; |
| 271 | paddingMethod:PaddingMethod; |
| 272 | dataLayout:DataLayout; |
| 273 | } |
| 274 | |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 275 | table QuantizeLayer { |
| 276 | base:LayerBase; |
| 277 | } |
| 278 | |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 279 | table SoftmaxLayer { |
| 280 | base:LayerBase; |
| 281 | descriptor:SoftmaxDescriptor; |
| 282 | } |
| 283 | |
| 284 | table SoftmaxDescriptor { |
| 285 | beta:float; |
| 286 | } |
| 287 | |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 288 | table DepthwiseConvolution2dLayer { |
| 289 | base:LayerBase; |
| 290 | descriptor:DepthwiseConvolution2dDescriptor; |
| 291 | weights:ConstTensor; |
| 292 | biases:ConstTensor; |
| 293 | } |
| 294 | |
| 295 | table DepthwiseConvolution2dDescriptor { |
| 296 | padLeft:uint; |
| 297 | padRight:uint; |
| 298 | padTop:uint; |
| 299 | padBottom:uint; |
| 300 | strideX:uint; |
| 301 | strideY:uint; |
Matthew Bentham | acad04e | 2019-05-13 10:02:45 +0100 | [diff] [blame] | 302 | dilationX:uint = 1; |
| 303 | dilationY:uint = 1; |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 304 | biasEnabled:bool = false; |
| 305 | dataLayout:DataLayout = NCHW; |
| 306 | } |
| 307 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 308 | table OutputLayer { |
| 309 | base:BindableLayerBase; |
| 310 | } |
| 311 | |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 312 | table ReshapeLayer { |
| 313 | base:LayerBase; |
| 314 | descriptor:ReshapeDescriptor; |
| 315 | } |
| 316 | |
| 317 | table ReshapeDescriptor { |
| 318 | targetShape:[uint]; |
| 319 | } |
| 320 | |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 321 | table PermuteLayer { |
| 322 | base:LayerBase; |
| 323 | descriptor:PermuteDescriptor; |
| 324 | } |
| 325 | |
| 326 | table PermuteDescriptor { |
| 327 | dimMappings:[uint]; |
| 328 | } |
| 329 | |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 330 | table SpaceToBatchNdLayer { |
| 331 | base:LayerBase; |
| 332 | descriptor:SpaceToBatchNdDescriptor; |
| 333 | } |
| 334 | |
| 335 | table SpaceToBatchNdDescriptor { |
| 336 | blockShape:[uint]; |
| 337 | padList:[uint]; |
| 338 | dataLayout:DataLayout; |
| 339 | } |
| 340 | |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 341 | table SubtractionLayer { |
| 342 | base:LayerBase; |
| 343 | } |
| 344 | |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 345 | table BatchToSpaceNdLayer { |
| 346 | base:LayerBase; |
| 347 | descriptor:BatchToSpaceNdDescriptor; |
| 348 | } |
| 349 | |
| 350 | table BatchToSpaceNdDescriptor { |
| 351 | blockShape:[uint]; |
| 352 | crops:[uint]; |
| 353 | dataLayout:DataLayout; |
| 354 | } |
| 355 | |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 356 | enum NormalizationAlgorithmChannel : byte { |
| 357 | Across = 0, |
| 358 | Within = 1 |
| 359 | } |
| 360 | |
| 361 | enum NormalizationAlgorithmMethod : byte { |
| 362 | LocalBrightness = 0, |
| 363 | LocalContrast = 1 |
| 364 | } |
| 365 | |
| 366 | table NormalizationLayer { |
| 367 | base:LayerBase; |
| 368 | descriptor:NormalizationDescriptor; |
| 369 | } |
| 370 | |
| 371 | table NormalizationDescriptor { |
| 372 | normChannelType:NormalizationAlgorithmChannel = Across; |
| 373 | normMethodType:NormalizationAlgorithmMethod = LocalBrightness; |
| 374 | normSize:uint; |
| 375 | alpha:float; |
| 376 | beta:float; |
| 377 | k:float; |
| 378 | dataLayout:DataLayout = NCHW; |
| 379 | } |
| 380 | |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 381 | table MeanLayer { |
| 382 | base:LayerBase; |
| 383 | descriptor:MeanDescriptor; |
| 384 | } |
| 385 | |
| 386 | table MeanDescriptor { |
| 387 | axis:[uint]; |
| 388 | keepDims:bool = false; |
| 389 | } |
| 390 | |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 391 | table PadLayer { |
| 392 | base:LayerBase; |
| 393 | descriptor:PadDescriptor; |
| 394 | } |
| 395 | |
| 396 | table PadDescriptor { |
| 397 | padList:[uint]; |
| 398 | } |
| 399 | |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 400 | table RsqrtLayer { |
| 401 | base:LayerBase; |
| 402 | } |
| 403 | |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 404 | table BatchNormalizationLayer { |
| 405 | base:LayerBase; |
| 406 | descriptor:BatchNormalizationDescriptor; |
| 407 | mean:ConstTensor; |
| 408 | variance:ConstTensor; |
| 409 | beta:ConstTensor; |
| 410 | gamma:ConstTensor; |
| 411 | } |
| 412 | |
| 413 | table BatchNormalizationDescriptor { |
| 414 | eps:float; |
| 415 | dataLayout:DataLayout; |
| 416 | } |
| 417 | |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 418 | table ResizeBilinearLayer { |
| 419 | base:LayerBase; |
| 420 | descriptor:ResizeBilinearDescriptor; |
| 421 | } |
| 422 | |
| 423 | table ResizeBilinearDescriptor { |
| 424 | targetWidth:uint; |
| 425 | targetHeight:uint; |
| 426 | dataLayout:DataLayout; |
| 427 | } |
| 428 | |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 429 | table StridedSliceLayer { |
| 430 | base:LayerBase; |
| 431 | descriptor:StridedSliceDescriptor; |
| 432 | } |
| 433 | |
| 434 | table StridedSliceDescriptor { |
| 435 | begin:[int]; |
| 436 | end:[int]; |
| 437 | stride:[int]; |
| 438 | beginMask:int; |
| 439 | endMask:int; |
| 440 | shrinkAxisMask:int; |
| 441 | ellipsisMask:int; |
| 442 | newAxisMask:int; |
| 443 | dataLayout:DataLayout; |
| 444 | } |
| 445 | |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame^] | 446 | table ConcatLayer { |
| 447 | base:LayerBase; |
| 448 | descriptor:OriginsDescriptor; |
| 449 | } |
| 450 | |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 451 | table MergerLayer { |
| 452 | base:LayerBase; |
| 453 | descriptor:OriginsDescriptor; |
| 454 | } |
| 455 | |
| 456 | table UintVector { |
| 457 | data:[uint]; |
| 458 | } |
| 459 | |
| 460 | table OriginsDescriptor { |
| 461 | concatAxis:uint; |
| 462 | numViews:uint; |
| 463 | numDimensions:uint; |
| 464 | viewOrigins:[UintVector]; |
| 465 | } |
| 466 | |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 467 | table ViewsDescriptor { |
| 468 | origins:OriginsDescriptor; |
| 469 | viewSizes:[UintVector]; |
| 470 | } |
| 471 | |
| 472 | table SplitterLayer { |
| 473 | base:LayerBase; |
| 474 | descriptor:ViewsDescriptor; |
| 475 | } |
| 476 | |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 477 | table DetectionPostProcessLayer { |
| 478 | base:LayerBase; |
| 479 | descriptor:DetectionPostProcessDescriptor; |
| 480 | anchors:ConstTensor; |
| 481 | } |
| 482 | |
| 483 | table DetectionPostProcessDescriptor { |
| 484 | maxDetections:uint; |
| 485 | maxClassesPerDetection:uint; |
| 486 | detectionsPerClass:uint; |
| 487 | nmsScoreThreshold:float; |
| 488 | nmsIouThreshold:float; |
| 489 | numClasses:uint; |
| 490 | useRegularNms:bool; |
| 491 | scaleX:float; |
| 492 | scaleY:float; |
| 493 | scaleW:float; |
| 494 | scaleH:float; |
| 495 | } |
| 496 | |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 497 | table LstmInputParams { |
| 498 | inputToForgetWeights:ConstTensor; |
| 499 | inputToCellWeights:ConstTensor; |
| 500 | inputToOutputWeights:ConstTensor; |
| 501 | recurrentToForgetWeights:ConstTensor; |
| 502 | recurrentToCellWeights:ConstTensor; |
| 503 | recurrentToOutputWeights:ConstTensor; |
| 504 | forgetGateBias:ConstTensor; |
| 505 | cellBias:ConstTensor; |
| 506 | outputGateBias:ConstTensor; |
| 507 | |
| 508 | inputToInputWeights:ConstTensor; |
| 509 | recurrentToInputWeights:ConstTensor; |
| 510 | cellToInputWeights:ConstTensor; |
| 511 | inputGateBias:ConstTensor; |
| 512 | |
| 513 | projectionWeights:ConstTensor; |
| 514 | projectionBias:ConstTensor; |
| 515 | |
| 516 | cellToForgetWeights:ConstTensor; |
| 517 | cellToOutputWeights:ConstTensor; |
| 518 | } |
| 519 | |
| 520 | table LstmDescriptor { |
| 521 | activationFunc:uint; |
| 522 | clippingThresCell:float; |
| 523 | clippingThresProj:float; |
| 524 | cifgEnabled:bool = true; |
| 525 | peepholeEnabled:bool = false; |
| 526 | projectionEnabled:bool = false; |
| 527 | } |
| 528 | |
| 529 | table LstmLayer { |
| 530 | base:LayerBase; |
| 531 | descriptor:LstmDescriptor; |
| 532 | inputParams:LstmInputParams; |
| 533 | } |
| 534 | |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 535 | table DequantizeLayer { |
| 536 | base:LayerBase; |
| 537 | } |
| 538 | |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 539 | table MergeLayer { |
| 540 | base:LayerBase; |
| 541 | } |
| 542 | |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 543 | table SwitchLayer { |
| 544 | base:LayerBase; |
| 545 | } |
| 546 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 547 | union Layer { |
Mike Kelly | af48401 | 2019-02-20 16:53:11 +0000 | [diff] [blame] | 548 | ActivationLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 549 | AdditionLayer, |
Nattapat Chaimanowong | 6b4ed98 | 2019-02-26 17:24:13 +0000 | [diff] [blame] | 550 | BatchToSpaceNdLayer, |
ruoyan01 | 8e7fa23 | 2019-02-28 15:09:07 +0000 | [diff] [blame] | 551 | BatchNormalizationLayer, |
Conor Kennedy | 7627788 | 2019-02-26 08:29:54 +0000 | [diff] [blame] | 552 | ConstantLayer, |
Mike Kelly | a0766c3 | 2019-02-19 17:22:07 +0000 | [diff] [blame] | 553 | Convolution2dLayer, |
Aron Virginas-Tar | c04125f | 2019-02-19 16:31:08 +0000 | [diff] [blame] | 554 | DepthwiseConvolution2dLayer, |
Sadik Armagan | dbb0c0c | 2019-02-21 09:01:41 +0000 | [diff] [blame] | 555 | FullyConnectedLayer, |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 556 | InputLayer, |
Sadik Armagan | 5f45027 | 2019-02-12 14:31:45 +0000 | [diff] [blame] | 557 | MultiplicationLayer, |
Aron Virginas-Tar | fc413c0 | 2019-02-13 15:41:52 +0000 | [diff] [blame] | 558 | OutputLayer, |
Nattapat Chaimanowong | 30b0020 | 2019-02-20 17:31:34 +0000 | [diff] [blame] | 559 | PermuteLayer, |
Saoirse Stewart | 3166c3e | 2019-02-18 15:24:53 +0000 | [diff] [blame] | 560 | Pooling2dLayer, |
Saoirse Stewart | 263829c | 2019-02-19 15:54:14 +0000 | [diff] [blame] | 561 | ReshapeLayer, |
Nattapat Chaimanowong | 4528699 | 2019-02-26 15:53:02 +0000 | [diff] [blame] | 562 | SoftmaxLayer, |
Éanna Ó Catháin | 5888589 | 2019-02-27 16:16:39 +0000 | [diff] [blame] | 563 | SpaceToBatchNdLayer, |
Aron Virginas-Tar | 0fe3245 | 2019-02-28 13:12:47 +0000 | [diff] [blame] | 564 | DivisionLayer, |
Nattapat Chaimanowong | 235cea5 | 2019-02-28 16:27:30 +0000 | [diff] [blame] | 565 | MinimumLayer, |
Aron Virginas-Tar | 377351e | 2019-02-27 14:42:31 +0000 | [diff] [blame] | 566 | EqualLayer, |
Nina Drozd | 5772878 | 2019-02-27 10:53:27 +0000 | [diff] [blame] | 567 | MaximumLayer, |
Nattapat Chaimanowong | ebb0f9c | 2019-03-01 12:14:06 +0000 | [diff] [blame] | 568 | NormalizationLayer, |
Sadik Armagan | 8b42a38 | 2019-03-01 14:24:49 +0000 | [diff] [blame] | 569 | PadLayer, |
Finn Williams | dd2ba7e | 2019-03-01 11:51:52 +0000 | [diff] [blame] | 570 | RsqrtLayer, |
Conor Kennedy | 79ffdf5 | 2019-03-01 14:24:54 +0000 | [diff] [blame] | 571 | FloorLayer, |
Nattapat Chaimanowong | 6522cdc | 2019-03-01 16:14:13 +0000 | [diff] [blame] | 572 | GreaterLayer, |
Conor Kennedy | da1f975 | 2019-03-01 14:37:12 +0000 | [diff] [blame] | 573 | ResizeBilinearLayer, |
Nattapat Chaimanowong | b348521 | 2019-03-04 12:35:39 +0000 | [diff] [blame] | 574 | SubtractionLayer, |
Saoirse Stewart | a1ed73a | 2019-03-04 13:40:12 +0000 | [diff] [blame] | 575 | StridedSliceLayer, |
Sadik Armagan | ac97c8c | 2019-03-04 17:44:21 +0000 | [diff] [blame] | 576 | GatherLayer, |
Jim Flynn | ac25a1b | 2019-02-28 10:40:49 +0000 | [diff] [blame] | 577 | MeanLayer, |
Narumol Prangnawarat | 495701f | 2019-03-07 17:31:34 +0000 | [diff] [blame] | 578 | MergerLayer, |
Jim Flynn | 18ce338 | 2019-03-08 11:08:30 +0000 | [diff] [blame] | 579 | L2NormalizationLayer, |
Nattapat Chaimanowong | 3e14a9d | 2019-03-18 12:37:06 +0000 | [diff] [blame] | 580 | SplitterLayer, |
Jim Flynn | 11af375 | 2019-03-19 17:22:29 +0000 | [diff] [blame] | 581 | DetectionPostProcessLayer, |
Derek Lamberti | 87acb27 | 2019-03-27 16:51:31 +0000 | [diff] [blame] | 582 | LstmLayer, |
Nattapat Chaimanowong | e4294fd | 2019-03-28 09:56:53 +0000 | [diff] [blame] | 583 | QuantizeLayer, |
Nattapat Chaimanowong | 1f88630 | 2019-04-05 13:37:19 +0100 | [diff] [blame] | 584 | DequantizeLayer, |
Sadik Armagan | eff363d | 2019-04-05 15:25:46 +0100 | [diff] [blame] | 585 | MergeLayer, |
Jim Flynn | e242f2d | 2019-05-22 14:24:13 +0100 | [diff] [blame^] | 586 | SwitchLayer, |
| 587 | ConcatLayer |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 588 | } |
| 589 | |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 590 | table AnyLayer { |
| 591 | layer:Layer; |
| 592 | } |
| 593 | |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 594 | // Root type for serialized data is the graph of the network |
| 595 | table SerializedGraph { |
Saoirse Stewart | 49dbe0e | 2019-02-05 17:27:06 +0000 | [diff] [blame] | 596 | layers:[AnyLayer]; |
Mike Kelly | 8c1701a | 2019-02-11 17:01:27 +0000 | [diff] [blame] | 597 | inputIds:[uint]; |
| 598 | outputIds:[uint]; |
Nattapat Chaimanowong | 969eea3 | 2019-01-30 13:33:11 +0000 | [diff] [blame] | 599 | } |
| 600 | |
| 601 | root_type SerializedGraph; |