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