2
0
Lutz Roeder 8 жил өмнө
parent
commit
10426719b7

+ 15 - 8
src/coreml-model.js

@@ -246,20 +246,27 @@ class CoreMLGraph {
                 if (type.multiArrayType.shape && type.multiArrayType.shape.length > 0) {
                     result += '[' + type.multiArrayType.shape.map(dimension => dimension.toString()).join(',') + ']';
                 }
-                return result;
+                break;
             case 'imageType':
-                return 'image(' + CoreMLGraph.formatColorSpace(type.imageType.colorSpace) + ',' + type.imageType.width.toString() + 'x' + type.imageType.height.toString() + ')';
+                result = 'image(' + CoreMLGraph.formatColorSpace(type.imageType.colorSpace) + ',' + type.imageType.width.toString() + 'x' + type.imageType.height.toString() + ')';
+                break;
             case 'dictionaryType':
-                return 'map<' + type.dictionaryType.KeyType.replace('KeyType', '') + ',double>';
+                result = 'map<' + type.dictionaryType.KeyType.replace('KeyType', '') + ',double>';
+                break;
             case 'stringType':
-                return 'string';
+                result = 'string';
+                break;
             case 'doubleType':
-                return 'double';
+                result = 'double';
+                break;
             case 'int64Type':
-                return 'int64';
+                result = 'int64';
+                break;
         }
-        debugger;
-        return '?';
+        if (type.isOptional) {
+            result += '?';
+        }
+        return result;
     }
 
     static formatArrayDataType(dataType) {

+ 6 - 4
src/coreml-operator.json

@@ -5,11 +5,13 @@
       "category": "Layer",
       "description": "A layer that performs spatial convolution or deconvolution.",
       "attributes": [
-        { "name": "outputShape", "hidden": true },
-        { "name": "outputChannels", "hidden": true },
-        { "name": "kernelChannels", "hidden": true },
+        { "name": "outputShape", "type": "tuple | None", "description": "Either None or a 2-tuple, specifying the output shape (output_height, output_width). Used only when is_deconv == True. When is_deconv == False, this parameter is ignored. If it is None, the output shape is calculated automatically using the border_mode. Kindly refer to NeuralNetwork.proto for details.", "hidden": true },
+        { "name": "outputChannels", "type": "int", "description": "The number of kernels. Same as ``C_out`` used in the layer description.", "hidden": true },
+        { "name": "kernelChannels", "type": "int", "description": "Channel dimension of the kernels. Must be equal to ``inputChannels / nGroups``, if isDeconvolution == False. Must be equal to ``inputChannels``, if isDeconvolution == True.", "hidden": true },
+        { "name": "nGroups", "type": "int", "description": "Group convolution, i.e. weight reuse along channel axis. Input and kernels are divided into g groups and convolution / deconvolution is applied within the groups independently. If not set or 0, it is set to the default value 1." },
+        { "name": "isDeconvolution", "type": "boolean", "description": "lag to specify whether it is a deconvolution layer." },
         { "name": "valid", "hidden": true },
-        { "name": "hasBias", "hidden": true }
+        { "name": "hasBias", "type": "boolean", "description": "Whether bias is ignored.", "hidden": true }
       ]
     }
   },