Quellcode durchsuchen

Update caffe-operator.json

Lutz Roeder vor 8 Jahren
Ursprung
Commit
6097f2661a
2 geänderte Dateien mit 52 neuen und 1 gelöschten Zeilen
  1. 5 1
      src/caffe-model.js
  2. 47 0
      src/caffe-operator.json

+ 5 - 1
src/caffe-model.js

@@ -179,7 +179,11 @@ class CaffeNode {
                 Object.keys(layer).forEach((key) => {
                     if (key.endsWith('Param')) {
                         var param = layer[key];
-                        if (param.constructor.name == this._type + 'Parameter') {
+                        var type = this._type;
+                        if (type == 'Deconvolution') {
+                            type = 'Convolution';
+                        }
+                        if (param.constructor.name == type + 'Parameter') {
                             Object.keys(param).forEach((attributeName) => {
                                 var attributeValue = param[attributeName];
                                 this._attributes.push(new CaffeAttribute(this, attributeName, attributeValue));

+ 47 - 0
src/caffe-operator.json

@@ -22,6 +22,29 @@
       ]
     }
   },
+  {
+    "name": "Deconvolution",
+    "schema": {
+      "category": "Layer",
+      "inputs": [
+        { "name": "input" },
+        { "name": "filter" },
+        { "name": "bias" }
+      ],
+      "ouptuts": [
+        { "name": "output" }
+      ],
+      "attributes": [
+        { "name": "bias_term", "hidden": true },
+        { "name": "weight_filler", "hidden": true },
+        { "name": "bias_filler", "hidden": true },
+        { "name": "pad", "default": [] },
+        { "name": "kernel_size", "default": [] },
+        { "name": "stride", "default": [] },
+        { "name": "dilation", "default": [] }
+      ]
+    }
+  },
   {
     "name": "InnerProduct",
     "schema": {
@@ -101,6 +124,16 @@
       ]
     }
   },
+  {
+    "name": "SoftmaxWithLoss",
+    "schema": {
+      "category": "Activation",
+      "inputs": [
+        { "name": "input" },
+        { "name": "labels" }
+      ]
+    }
+  },
   {
     "name": "ReLU",
     "schema": {
@@ -139,6 +172,12 @@
       "category": "Pool"
     }
   },
+  {
+    "name": "Crop",
+    "schema": {
+      "category": "Shape"
+    }
+  },
   {
     "name": "Data",
     "schema": {
@@ -156,5 +195,13 @@
         { "name": "outputs", "option": "variadic" }
       ]
     }
+  },
+  {
+    "name": "Python",
+    "schema": {
+      "outputs": [
+        { "name": "outputs", "option": "variadic" }
+      ]
+    }
   }
 ]