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