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