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