Lutz Roeder 8 лет назад
Родитель
Сommit
d50889a040
5 измененных файлов с 37 добавлено и 20 удалено
  1. 9 0
      src/onnx-operator.json
  2. 8 3
      src/view-render.css
  3. 3 1
      src/view-tf.js
  4. 3 3
      src/view-tflite.js
  5. 14 13
      tools/onnx-operator-json.py

+ 9 - 0
src/onnx-operator.json

@@ -453,6 +453,7 @@
           "type": "list of ints"
         }
       ],
+      "category": "Pool",
       "description": "AveragePool consumes an input tensor X and applies average pooling across the\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n average pooling consisting of computing the average on all values of a\n subset of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing.",
       "domain": "ai.onnx",
       "inputs": [
@@ -2354,6 +2355,7 @@
   {
     "name": "GlobalAveragePool",
     "schema": {
+      "category": "Pool",
       "description": "GlobalAveragePool consumes an input tensor X and applies average pooling across the\n the values in the same channel. This is equivalent to AveragePool with kernel size\n equal to the spatial dimension of input tensor.",
       "domain": "ai.onnx",
       "inputs": [
@@ -2400,6 +2402,7 @@
           "type": "float"
         }
       ],
+      "category": "Pool",
       "description": "GlobalLpPool consumes an input tensor X and applies lp pool pooling across the\n the values in the same channel. This is equivalent to LpPool with kernel size\n equal to the spatial dimension of input tensor.",
       "domain": "ai.onnx",
       "inputs": [
@@ -2446,6 +2449,7 @@
           "type": "int"
         }
       ],
+      "category": "Pool",
       "description": "GlobalLpPool consumes an input tensor X and applies lp pool pooling across the\n the values in the same channel. This is equivalent to LpPool with kernel size\n equal to the spatial dimension of input tensor.",
       "domain": "ai.onnx",
       "inputs": [
@@ -2484,6 +2488,7 @@
   {
     "name": "GlobalMaxPool",
     "schema": {
+      "category": "Pool",
       "description": "GlobalMaxPool consumes an input tensor X and applies max pooling across the\n the values in the same channel. This is equivalent to MaxPool with kernel size\n equal to the spatial dimension of input tensor.",
       "domain": "ai.onnx",
       "inputs": [
@@ -3607,6 +3612,7 @@
           "type": "list of ints"
         }
       ],
+      "category": "Pool",
       "description": "LpPool consumes an input tensor X and applies Lp pooling across the\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n Lp pooling consisting of computing the Lp norm on all values of a subset \n of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing.",
       "domain": "ai.onnx",
       "inputs": [
@@ -3677,6 +3683,7 @@
           "type": "list of ints"
         }
       ],
+      "category": "Pool",
       "description": "LpPool consumes an input tensor X and applies Lp pooling across the\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n Lp pooling consisting of computing the Lp norm on all values of a subset\n of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing.",
       "domain": "ai.onnx",
       "inputs": [
@@ -3829,6 +3836,7 @@
           "type": "list of ints"
         }
       ],
+      "category": "Pool",
       "description": "MaxPool consumes an input tensor X and applies max pooling across the\n the tensor according to kernel sizes, stride sizes, and pad lengths.\n max pooling consisting of computing the max on all values of a\n subset of the input tensor according to the kernel size and downsampling the\n data into the output tensor Y for further processing.",
       "domain": "ai.onnx",
       "inputs": [
@@ -3881,6 +3889,7 @@
           "type": "float"
         }
       ],
+      "category": "Pool",
       "description": "ROI max pool consumes an input tensor X and region of interests (RoIs) to\n apply max pooling across each RoI, to produce output 4-D tensor of shape\n (num_rois, channels, pooled_shape[0], pooled_shape[1]).",
       "domain": "ai.onnx",
       "inputs": [

+ 8 - 3
src/view-render.css

@@ -17,9 +17,14 @@
 .node-item-operator-constant text { fill: #000; }
 .node-item-operator-constant:hover path { fill: #fff; }
 .node-item-operator-layer path { fill: #358; }
-.node-item-operator-activation path { fill: #354; }
-.node-item-operator-normalization path { fill: #534; }
-.node-item-operator-shape path { fill: #503; }
+.node-item-operator-activation path { fill: #4B1B16; }
+.node-item-operator-pool path { fill: #353; }
+.node-item-operator-normalization path { fill: #354; }
+.node-item-operator-dropout path { fill: #454757; }
+.node-item-operator-shape path { fill: #6C4F47; }
+.node-item-operator-tensor path { fill: #59423B; }
+.node-item-operator-control path { fill: #eee; }
+.node-item-operator-control text { fill: #000; }
 
 .node-item-input path { fill: #fff; }
 .node-item-input:hover { cursor: hand; }

+ 3 - 1
src/view-tf.js

@@ -741,7 +741,9 @@ class TensorFlowOperatorMetadata {
                 'Const': 'Constant',
                 'Conv2D': 'Layer',
                 'Relu': 'Activation',
-                // 'Identity':
+                'LRN': 'Normalization',
+                'MaxPool': 'Pool',
+                'Identity': 'Control',
                 // 'VariableV2':
                 // 'Assign':
                 // 'BiasAdd':

+ 3 - 3
src/view-tflite.js

@@ -562,14 +562,14 @@ class TensorFlowLiteOperatorMetadata {
                 'Softmax': 'Activation',
                 'Reshape': 'Shape',
                 'Normalize': 'Normalization',
-                // 'AveragePool2D': '',
-                // 'MaxPool2D':
+                'AveragePool2D': 'Pool',
+                'MaxPool2D': 'Pool',
+                'Concatenation': 'Tensor',            
                 // 'LSHProjection': 
                 // 'Predict': 
                 // 'HashtableLookup':
                 // 'ExtractFeatures': 
                 // 'SkipGram':
-                // 'Concatenation':            
             };
         }
 

+ 14 - 13
tools/onnx-operator-json.py

@@ -54,14 +54,20 @@ categories = {
     'Greater': 'Logic',
     'Equal': 'Logic',
 
-    # 'Dropout':
-    # 'AveragePool':
-    # 'GlobalAveragePool':
-    # 'GlobalLpPool':
-    # 'GlobalMaxPool':
-    # 'LpPool':
-    # 'MaxPool':
-    # 'MaxRoiPool':
+    'AveragePool': 'Pool',
+    'GlobalAveragePool': 'Pool',
+    'GlobalLpPool': 'Pool',
+    'GlobalMaxPool': 'Pool',
+    'LpPool': 'Pool',
+    'MaxPool': 'Pool',
+    'MaxRoiPool': 'Pool',
+
+    'Concat': 'tensor',
+    'Slice': 'tensor',
+    'Split': 'tensor',
+
+    # 'Gemm': '',
+    # 'MatMul': '',
     # 'Hardmax':
     # 'Log':
     # 'Max':
@@ -78,9 +84,6 @@ categories = {
     # 'Abs': 'Basic',
     # 'Add': 'Basic',
     # 'Pow': 'Basic',
-    # 'Gemm': '',
-    # 'MatMul': '',
-    # 'Concat': 
     # 'ArgMax':
     # 'ArgMin':
     # 'Cast':
@@ -103,9 +106,7 @@ categories = {
     # 'ReduceProd':
     # 'ReduceSum':
     # 'ReduceSumSquare':
-    # 'Slice':
     # 'SpaceToDepth':
-    # 'Split':
     # 'Squeeze':
     # 'Tile':
     # 'Gather':