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