diff --git a/Jenkinsfile b/Jenkinsfile
index 68e8e36aa..74503dbea 100644
--- a/Jenkinsfile
+++ b/Jenkinsfile
@@ -1,20 +1,21 @@
-/*
- * ******************************************************************************
- * * Copyright (c) 2021 Deeplearning4j Contributors
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
+
+ /* ******************************************************************************
+ *
+ *
+ * This program and the accompanying materials are made available under the
+ * terms of the Apache License, Version 2.0 which is available at
+ * https://www.apache.org/licenses/LICENSE-2.0.
+ *
+ * See the NOTICE file distributed with this work for additional
+ * information regarding copyright ownership.
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+ * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+ * License for the specific language governing permissions and limitations
+ * under the License.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ ******************************************************************************/
#!groovy
diff --git a/contrib/codegen-tools/libnd4j-gen/op-ir.proto b/contrib/codegen-tools/libnd4j-gen/op-ir.proto
index 0982d23b2..b7ee920f0 100644
--- a/contrib/codegen-tools/libnd4j-gen/op-ir.proto
+++ b/contrib/codegen-tools/libnd4j-gen/op-ir.proto
@@ -12,6 +12,23 @@ opList {
}
opList {
name: "BinaryMinimalRelativeError"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "input"
+ argType: INPUT_TENSOR
+ }
+ argDescriptor {
+ name: "y"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dataType"
+ argType: DATA_TYPE
+ }
argDescriptor {
name: "thresholdRelative"
argType: DOUBLE
@@ -21,31 +38,10 @@ opList {
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
- }
- argDescriptor {
- name: "y"
- argType: INPUT_TENSOR
- argIndex: 1
- }
- argDescriptor {
- name: "dataType"
- argType: DATA_TYPE
- }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "BinaryRelativeError"
- argDescriptor {
- name: "threshold"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -67,10 +63,26 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "threshold"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "ClipByValue"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "inPlace"
+ argType: BOOL
+ }
+ argDescriptor {
+ name: "input"
+ argType: INPUT_TENSOR
+ }
argDescriptor {
name: "clipValueMin"
argType: DOUBLE
@@ -80,18 +92,6 @@ opList {
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "inPlace"
- argType: BOOL
- }
- argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
- }
}
opList {
name: "Conditional"
@@ -305,10 +305,6 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "isConstant"
argType: BOOL
@@ -317,6 +313,10 @@ opList {
name: "condition"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
opDeclarationType: LOGIC_OP_IMPL
}
opList {
@@ -366,10 +366,6 @@ opList {
}
opList {
name: "_powderivative"
- argDescriptor {
- name: "pow"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -382,6 +378,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "pow"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -609,15 +609,6 @@ opList {
}
opList {
name: "ada_delta_updater"
- argDescriptor {
- name: "dRho"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -661,12 +652,8 @@ opList {
argType: INPUT_TENSOR
argIndex: 5
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "ada_grad_updater"
argDescriptor {
- name: "dLr"
+ name: "dRho"
argType: DOUBLE
}
argDescriptor {
@@ -674,6 +661,10 @@ opList {
argType: DOUBLE
argIndex: 1
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "ada_grad_updater"
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -702,29 +693,19 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "ada_max_updater"
argDescriptor {
name: "dLr"
argType: DOUBLE
}
argDescriptor {
- name: "dBeta1"
+ name: "dEpsilon"
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "dBeta2"
- argType: DOUBLE
- argIndex: 2
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 3
- }
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "ada_max_updater"
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -777,29 +758,29 @@ opList {
name: "iteration"
argType: INT64
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dBeta1"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dBeta2"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "dEpsilon"
+ argType: DOUBLE
+ argIndex: 3
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "adam_updater"
- argDescriptor {
- name: "dLr"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dBeta1"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "dBeta2"
- argType: DOUBLE
- argIndex: 2
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 3
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -852,6 +833,25 @@ opList {
name: "iteration"
argType: INT64
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dBeta1"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dBeta2"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "dEpsilon"
+ argType: DOUBLE
+ argIndex: 3
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -948,10 +948,6 @@ opList {
}
opList {
name: "adjust_contrast_v2"
- argDescriptor {
- name: "factor"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -965,6 +961,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "factor"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -986,14 +986,14 @@ opList {
name: "dimC"
argType: INT64
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "adjust_saturation"
argDescriptor {
name: "factor"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "adjust_saturation"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -1011,6 +1011,10 @@ opList {
name: "dimC"
argType: INT64
}
+ argDescriptor {
+ name: "factor"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -1040,6 +1044,14 @@ opList {
}
opList {
name: "alpha_dropout"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "input"
+ argType: INPUT_TENSOR
+ }
argDescriptor {
name: "a"
argType: DOUBLE
@@ -1059,37 +1071,10 @@ opList {
argType: DOUBLE
argIndex: 3
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
- }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "alpha_dropout_bp"
- argDescriptor {
- name: "probValue"
- argType: DOUBLE
- }
- argDescriptor {
- name: "alphaValue"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "alpha1Value"
- argType: DOUBLE
- argIndex: 2
- }
- argDescriptor {
- name: "betaValue"
- argType: DOUBLE
- argIndex: 3
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -1112,6 +1097,25 @@ opList {
name: "seed"
argType: INT64
}
+ argDescriptor {
+ name: "probValue"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "alphaValue"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "alpha1Value"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "betaValue"
+ argType: DOUBLE
+ argIndex: 3
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -1233,25 +1237,6 @@ opList {
}
opList {
name: "ams_grad_updater"
- argDescriptor {
- name: "dLr"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dBeta1"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "dBeta2"
- argType: DOUBLE
- argIndex: 2
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 3
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -1314,14 +1299,29 @@ opList {
name: "iteration"
argType: INT64
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dBeta1"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dBeta2"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "dEpsilon"
+ argType: DOUBLE
+ argIndex: 3
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "and"
- argDescriptor {
- name: "comparable"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -1338,6 +1338,10 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "comparable"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -1383,10 +1387,6 @@ opList {
}
opList {
name: "apply_sgd"
- argDescriptor {
- name: "lr"
- argType: DOUBLE
- }
argDescriptor {
name: "Z"
argType: OUTPUT_TENSOR
@@ -1405,6 +1405,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
+ argDescriptor {
+ name: "lr"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -1688,10 +1692,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -1746,6 +1746,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "avgpool2d_bp"
@@ -1762,10 +1766,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -1820,6 +1820,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "avgpool3dnew"
@@ -1831,10 +1835,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -1909,6 +1909,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "avgpool3dnew_bp"
@@ -1925,10 +1929,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -2003,13 +2003,13 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "axpy"
- argDescriptor {
- name: "a"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -2036,6 +2036,10 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "a"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -2290,10 +2294,6 @@ opList {
}
opList {
name: "batchnorm"
- argDescriptor {
- name: "epsilon"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -2344,13 +2344,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "batchnorm_bp"
argDescriptor {
name: "epsilon"
argType: DOUBLE
}
+}
+opList {
+ name: "batchnorm_bp"
argDescriptor {
name: "dLdI"
argType: OUTPUT_TENSOR
@@ -2416,6 +2416,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "epsilon"
+ argType: DOUBLE
+ }
}
opList {
name: "betainc"
@@ -3035,10 +3039,6 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "inPlace"
- argType: BOOL
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
@@ -3231,20 +3231,6 @@ opList {
}
opList {
name: "car"
- argDescriptor {
- name: "compare"
- argType: DOUBLE
- }
- argDescriptor {
- name: "set"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- argIndex: 2
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3266,10 +3252,6 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
- opDeclarationType: LEGACY_XYZ
-}
-opList {
- name: "cas"
argDescriptor {
name: "compare"
argType: DOUBLE
@@ -3284,6 +3266,10 @@ opList {
argType: DOUBLE
argIndex: 2
}
+ opDeclarationType: LEGACY_XYZ
+}
+opList {
+ name: "cas"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3300,6 +3286,20 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "compare"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "set"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ argIndex: 2
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -3529,10 +3529,6 @@ opList {
}
opList {
name: "choose"
- argDescriptor {
- name: "scalar"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3559,13 +3555,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "scalar"
+ argType: DOUBLE
+ }
}
opList {
name: "clip_by_global_norm"
- argDescriptor {
- name: "clipNorm"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3578,13 +3574,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "clipbyavgnorm"
argDescriptor {
name: "clipNorm"
argType: DOUBLE
}
+}
+opList {
+ name: "clipbyavgnorm"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3597,14 +3593,14 @@ opList {
name: "dimensions"
argType: INT64
}
+ argDescriptor {
+ name: "clipNorm"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "clipbyavgnorm_bp"
- argDescriptor {
- name: "clipNorm"
- argType: DOUBLE
- }
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -3622,13 +3618,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "clipNorm"
+ argType: DOUBLE
+ }
}
opList {
name: "clipbynorm"
- argDescriptor {
- name: "clipValue"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3641,14 +3637,14 @@ opList {
name: "dimensions"
argType: INT64
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "clipbynorm_bp"
argDescriptor {
name: "clipValue"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "clipbynorm_bp"
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -3670,9 +3666,21 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "clipValue"
+ argType: DOUBLE
+ }
}
opList {
name: "clipbyvalue"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "input"
+ argType: INPUT_TENSOR
+ }
argDescriptor {
name: "left"
argType: DOUBLE
@@ -3682,14 +3690,6 @@ opList {
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
- }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -3765,10 +3765,6 @@ opList {
}
opList {
name: "compare_and_bitpack"
- argDescriptor {
- name: "threshold"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -3786,6 +3782,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "threshold"
+ argType: DOUBLE
+ }
}
opList {
name: "compat_sparse_to_dense"
@@ -3957,10 +3957,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kW"
argType: INT64
@@ -3995,6 +3991,10 @@ opList {
argType: INT64
argIndex: 6
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "conv1d_bp"
@@ -4090,10 +4090,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -4148,6 +4144,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "conv2d_bp"
@@ -4184,10 +4184,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -4242,6 +4238,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "conv2d_input_bp"
@@ -4263,10 +4263,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -4321,6 +4317,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "conv3dnew"
@@ -4342,10 +4342,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -4420,6 +4416,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "conv3dnew_bp"
@@ -4456,10 +4456,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -4534,6 +4530,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "copy"
@@ -4874,10 +4874,6 @@ opList {
}
opList {
name: "crop_and_resize"
- argDescriptor {
- name: "extrapolationVal"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -4909,6 +4905,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "extrapolationVal"
+ argType: DOUBLE
+ }
}
opList {
name: "cross"
@@ -5270,10 +5270,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -5328,6 +5324,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "deconv2d_bp"
@@ -5364,10 +5364,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -5422,6 +5418,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "deconv2d_tf"
@@ -5443,10 +5443,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -5501,6 +5497,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "deconv3d"
@@ -5522,10 +5522,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -5600,6 +5596,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "deconv3d_bp"
@@ -5636,10 +5636,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -5714,6 +5710,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "deconv3d_tf"
@@ -5780,10 +5780,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -5838,6 +5834,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "depthwise_conv2d_bp"
@@ -5874,10 +5874,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -5932,6 +5928,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "diag"
@@ -6038,10 +6038,6 @@ opList {
}
opList {
name: "distribution_bernoulli"
- argDescriptor {
- name: "prob"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6055,14 +6051,14 @@ opList {
argType: INT64
argIndex: 1
}
+ argDescriptor {
+ name: "prob"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "distribution_binomial"
- argDescriptor {
- name: "probability"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6081,14 +6077,14 @@ opList {
argType: INT64
argIndex: 2
}
- opDeclarationType: LEGACY_XYZ
-}
-opList {
- name: "distribution_binomial_ex"
argDescriptor {
name: "probability"
argType: DOUBLE
}
+ opDeclarationType: LEGACY_XYZ
+}
+opList {
+ name: "distribution_binomial_ex"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6101,19 +6097,14 @@ opList {
name: "trials"
argType: INT64
}
+ argDescriptor {
+ name: "probability"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "distribution_gaussian"
- argDescriptor {
- name: "mean"
- argType: DOUBLE
- }
- argDescriptor {
- name: "stddev"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6127,10 +6118,32 @@ opList {
argType: INT64
argIndex: 1
}
+ argDescriptor {
+ name: "mean"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "stddev"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "distribution_lognormal"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "dataType"
+ argType: INT64
+ }
+ argDescriptor {
+ name: "shape"
+ argType: INT64
+ argIndex: 1
+ }
argDescriptor {
name: "mean"
argType: DOUBLE
@@ -6140,6 +6153,10 @@ opList {
argType: DOUBLE
argIndex: 1
}
+ opDeclarationType: LEGACY_XYZ
+}
+opList {
+ name: "distribution_truncated"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6153,10 +6170,6 @@ opList {
argType: INT64
argIndex: 1
}
- opDeclarationType: LEGACY_XYZ
-}
-opList {
- name: "distribution_truncated"
argDescriptor {
name: "mean"
argType: DOUBLE
@@ -6166,6 +6179,10 @@ opList {
argType: DOUBLE
argIndex: 1
}
+ opDeclarationType: LEGACY_XYZ
+}
+opList {
+ name: "distribution_uniform"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6179,10 +6196,6 @@ opList {
argType: INT64
argIndex: 1
}
- opDeclarationType: LEGACY_XYZ
-}
-opList {
- name: "distribution_uniform"
argDescriptor {
name: "from"
argType: DOUBLE
@@ -6192,19 +6205,6 @@ opList {
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "dataType"
- argType: INT64
- }
- argDescriptor {
- name: "shape"
- argType: INT64
- argIndex: 1
- }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -6460,10 +6460,6 @@ opList {
}
opList {
name: "dropout"
- argDescriptor {
- name: "probValue"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6481,14 +6477,14 @@ opList {
name: "seed"
argType: INT64
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "dropout_bp"
argDescriptor {
name: "probValue"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "dropout_bp"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6511,14 +6507,14 @@ opList {
name: "seed"
argType: INT64
}
+ argDescriptor {
+ name: "probValue"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "dropout_inverted"
- argDescriptor {
- name: "p"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6527,6 +6523,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "p"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -6726,10 +6726,6 @@ opList {
}
opList {
name: "elu"
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6738,14 +6734,14 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "elu_bp"
argDescriptor {
name: "alpha"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "elu_bp"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -6759,6 +6755,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "alpha"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -6780,11 +6780,6 @@ opList {
name: "partition_mode"
argType: INT64
}
- argDescriptor {
- name: "indices"
- argType: INT64
- argIndex: 1
- }
argDescriptor {
name: "dtype"
argType: DATA_TYPE
@@ -6792,10 +6787,6 @@ opList {
}
opList {
name: "encode_bitmap"
- argDescriptor {
- name: "threshold"
- argType: DOUBLE
- }
argDescriptor {
name: "encoded"
argType: OUTPUT_TENSOR
@@ -6823,13 +6814,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "encode_threshold"
argDescriptor {
name: "threshold"
argType: DOUBLE
}
+}
+opList {
+ name: "encode_threshold"
argDescriptor {
name: "updated"
argType: OUTPUT_TENSOR
@@ -6856,6 +6847,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "threshold"
+ argType: DOUBLE
+ }
}
opList {
name: "enter"
@@ -6863,10 +6858,6 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "isConstant"
argType: BOOL
@@ -6875,6 +6866,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
}
opList {
name: "entropy"
@@ -6985,10 +6980,6 @@ opList {
}
opList {
name: "equals_with_eps"
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -7010,6 +7001,10 @@ opList {
name: "dimensions"
argType: INT64
}
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -7117,14 +7112,14 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
}
opList {
name: "exp"
@@ -7214,10 +7209,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "ksizeRows"
argType: INT64
@@ -7252,13 +7243,13 @@ opList {
argType: INT64
argIndex: 6
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "eye"
- argDescriptor {
- name: "dataType"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -7286,18 +7277,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "dataType"
+ argType: DOUBLE
+ }
}
opList {
name: "fake_quant_with_min_max_args"
- argDescriptor {
- name: "min"
- argType: DOUBLE
- }
- argDescriptor {
- name: "max"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -7314,18 +7300,18 @@ opList {
name: "numBits"
argType: INT64
}
-}
-opList {
- name: "fake_quant_with_min_max_vars"
argDescriptor {
- name: "m"
+ name: "min"
argType: DOUBLE
}
argDescriptor {
- name: "m2"
+ name: "max"
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "fake_quant_with_min_max_vars"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -7352,6 +7338,15 @@ opList {
name: "numBits"
argType: INT64
}
+ argDescriptor {
+ name: "m"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "m2"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -7386,18 +7381,19 @@ opList {
}
opList {
name: "fill"
- argDescriptor {
- name: "value"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "shapeArray"
+ name: "shape"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "outputs"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
argDescriptor {
name: "dtype"
argType: INT64
@@ -7406,6 +7402,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "value"
+ argType: DOUBLE
+ }
}
opList {
name: "fill_as"
@@ -7436,15 +7436,6 @@ opList {
}
opList {
name: "first_index"
- argDescriptor {
- name: "compare"
- argType: DOUBLE
- }
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -7458,9 +7449,18 @@ opList {
argType: INPUT_TENSOR
}
argDescriptor {
- name: "mode"
+ name: "dimensions"
argType: INT64
}
+ argDescriptor {
+ name: "compare"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -7683,10 +7683,6 @@ opList {
}
opList {
name: "fused_batch_norm"
- argDescriptor {
- name: "epsilon"
- argType: DOUBLE
- }
argDescriptor {
name: "y"
argType: OUTPUT_TENSOR
@@ -7743,6 +7739,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "epsilon"
+ argType: DOUBLE
+ }
}
opList {
name: "gather"
@@ -8553,10 +8553,6 @@ opList {
}
opList {
name: "huber_loss"
- argDescriptor {
- name: "delta"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -8583,13 +8579,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "huber_loss_grad"
argDescriptor {
name: "delta"
argType: DOUBLE
}
+}
+opList {
+ name: "huber_loss_grad"
argDescriptor {
name: "dLdp"
argType: OUTPUT_TENSOR
@@ -8626,6 +8622,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "delta"
+ argType: DOUBLE
+ }
}
opList {
name: "identity"
@@ -8715,10 +8715,6 @@ opList {
}
opList {
name: "im2col"
- argDescriptor {
- name: "zeroPadVal"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -8775,13 +8771,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "im2col_bp"
argDescriptor {
name: "zeroPadVal"
argType: DOUBLE
}
+}
+opList {
+ name: "im2col_bp"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -8838,6 +8834,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "zeroPadVal"
+ argType: DOUBLE
+ }
}
opList {
name: "image_resize"
@@ -9121,15 +9121,6 @@ opList {
}
opList {
name: "last_index"
- argDescriptor {
- name: "compare"
- argType: DOUBLE
- }
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9143,9 +9134,18 @@ opList {
argType: INPUT_TENSOR
}
argDescriptor {
- name: "mode"
+ name: "dimensions"
argType: INT64
}
+ argDescriptor {
+ name: "compare"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -9155,7 +9155,7 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "noBias"
+ name: "channelsFirst"
argType: BOOL
}
argDescriptor {
@@ -9195,7 +9195,7 @@ opList {
argIndex: 2
}
argDescriptor {
- name: "noBias"
+ name: "channelsFirst"
argType: BOOL
}
argDescriptor {
@@ -9243,10 +9243,6 @@ opList {
}
opList {
name: "leakyrelu"
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9259,14 +9255,14 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "alpha"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "leakyreluderivative"
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9279,6 +9275,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "alpha"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -9377,15 +9377,6 @@ opList {
}
opList {
name: "lin_space"
- argDescriptor {
- name: "start"
- argType: DOUBLE
- }
- argDescriptor {
- name: "stop"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9405,30 +9396,25 @@ opList {
argIndex: 2
}
argDescriptor {
- name: "elements"
+ name: "dataType"
argType: INT64
}
- argDescriptor {
- name: "number"
- argType: INT64
- argIndex: 1
- }
argDescriptor {
name: "dataType"
argType: DATA_TYPE
}
-}
-opList {
- name: "linspace_random"
argDescriptor {
- name: "from"
+ name: "start"
argType: DOUBLE
}
argDescriptor {
- name: "to"
+ name: "stop"
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "linspace_random"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9437,6 +9423,20 @@ opList {
name: "length"
argType: INT64
}
+ argDescriptor {
+ name: "dataType"
+ argType: INT64
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "from"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "step"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -9506,10 +9506,6 @@ opList {
}
opList {
name: "log_loss"
- argDescriptor {
- name: "epsilon"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9536,13 +9532,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "log_loss_grad"
argDescriptor {
name: "epsilon"
argType: DOUBLE
}
+}
+opList {
+ name: "log_loss_grad"
argDescriptor {
name: "dLdp"
argType: OUTPUT_TENSOR
@@ -9579,6 +9575,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "epsilon"
+ argType: DOUBLE
+ }
}
opList {
name: "log_matrix_determinant"
@@ -9714,10 +9714,6 @@ opList {
}
opList {
name: "log_x"
- argDescriptor {
- name: "base"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9726,6 +9722,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "base"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -9794,21 +9794,17 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
}
opList {
name: "lrelu"
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9817,14 +9813,14 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "lrelu_bp"
argDescriptor {
name: "alpha"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "lrelu_bp"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9838,24 +9834,14 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "alpha"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "lrn"
- argDescriptor {
- name: "bias"
- argType: DOUBLE
- }
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "beta"
- argType: DOUBLE
- argIndex: 2
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -9872,10 +9858,6 @@ opList {
name: "depth"
argType: INT64
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "lrn_bp"
argDescriptor {
name: "bias"
argType: DOUBLE
@@ -9890,6 +9872,10 @@ opList {
argType: DOUBLE
argIndex: 2
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "lrn_bp"
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -9911,24 +9897,24 @@ opList {
name: "depth"
argType: INT64
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "lstm"
argDescriptor {
- name: "clippingCellValue"
+ name: "bias"
argType: DOUBLE
}
argDescriptor {
- name: "clippingProjValue"
+ name: "alpha"
argType: DOUBLE
argIndex: 1
}
argDescriptor {
- name: "forgetBias"
+ name: "beta"
argType: DOUBLE
argIndex: 2
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "lstm"
argDescriptor {
name: "h"
argType: OUTPUT_TENSOR
@@ -9990,18 +9976,23 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "lstmBlock"
- argDescriptor {
- name: "forgetBias"
- argType: DOUBLE
- }
argDescriptor {
name: "clippingCellValue"
argType: DOUBLE
+ }
+ argDescriptor {
+ name: "clippingProjValue"
+ argType: DOUBLE
argIndex: 1
}
+ argDescriptor {
+ name: "forgetBias"
+ argType: DOUBLE
+ argIndex: 2
+ }
+}
+opList {
+ name: "lstmBlock"
argDescriptor {
name: "i"
argType: OUTPUT_TENSOR
@@ -10093,9 +10084,6 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "lstmBlockCell"
argDescriptor {
name: "forgetBias"
argType: DOUBLE
@@ -10105,6 +10093,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "lstmBlockCell"
argDescriptor {
name: "i"
argType: OUTPUT_TENSOR
@@ -10186,23 +10177,18 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "lstmCell"
- argDescriptor {
- name: "clippingCellValue"
- argType: DOUBLE
- }
- argDescriptor {
- name: "clippingProjValue"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "forgetBias"
argType: DOUBLE
- argIndex: 2
}
+ argDescriptor {
+ name: "clippingCellValue"
+ argType: DOUBLE
+ argIndex: 1
+ }
+}
+opList {
+ name: "lstmCell"
argDescriptor {
name: "ht"
argType: OUTPUT_TENSOR
@@ -10264,43 +10250,23 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "lstmLayer"
argDescriptor {
- name: "cellClip"
+ name: "clippingCellValue"
argType: DOUBLE
}
argDescriptor {
- name: "gateAlpha"
+ name: "clippingProjValue"
argType: DOUBLE
argIndex: 1
}
argDescriptor {
- name: "gateBeta"
+ name: "forgetBias"
argType: DOUBLE
argIndex: 2
}
- argDescriptor {
- name: "cellAlpha"
- argType: DOUBLE
- argIndex: 3
- }
- argDescriptor {
- name: "cellBeta"
- argType: DOUBLE
- argIndex: 4
- }
- argDescriptor {
- name: "outAlpha"
- argType: DOUBLE
- argIndex: 5
- }
- argDescriptor {
- name: "outBeta"
- argType: DOUBLE
- argIndex: 6
- }
+}
+opList {
+ name: "lstmLayer"
argDescriptor {
name: "h"
argType: OUTPUT_TENSOR
@@ -10393,10 +10359,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 7
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "dataFormat"
argType: INT64
@@ -10421,9 +10383,10 @@ opList {
argType: INT64
argIndex: 4
}
-}
-opList {
- name: "lstmLayerCell"
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
argDescriptor {
name: "cellClip"
argType: DOUBLE
@@ -10458,6 +10421,9 @@ opList {
argType: DOUBLE
argIndex: 6
}
+}
+opList {
+ name: "lstmLayerCell"
argDescriptor {
name: "h"
argType: OUTPUT_TENSOR
@@ -10528,9 +10494,6 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "lstmLayerCellBp"
argDescriptor {
name: "cellClip"
argType: DOUBLE
@@ -10565,6 +10528,9 @@ opList {
argType: DOUBLE
argIndex: 6
}
+}
+opList {
+ name: "lstmLayerCellBp"
argDescriptor {
name: "dLdx"
argType: OUTPUT_TENSOR
@@ -10647,10 +10613,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 7
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "gateAct"
argType: INT64
@@ -10665,9 +10627,10 @@ opList {
argType: INT64
argIndex: 2
}
-}
-opList {
- name: "lstmLayer_bp"
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
argDescriptor {
name: "cellClip"
argType: DOUBLE
@@ -10702,6 +10665,9 @@ opList {
argType: DOUBLE
argIndex: 6
}
+}
+opList {
+ name: "lstmLayer_bp"
argDescriptor {
name: "dLdx"
argType: OUTPUT_TENSOR
@@ -10834,10 +10800,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 11
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "dataFormat"
argType: INT64
@@ -10862,13 +10824,47 @@ opList {
argType: INT64
argIndex: 4
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
+ argDescriptor {
+ name: "cellClip"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "gateAlpha"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "gateBeta"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "cellAlpha"
+ argType: DOUBLE
+ argIndex: 3
+ }
+ argDescriptor {
+ name: "cellBeta"
+ argType: DOUBLE
+ argIndex: 4
+ }
+ argDescriptor {
+ name: "outAlpha"
+ argType: DOUBLE
+ argIndex: 5
+ }
+ argDescriptor {
+ name: "outBeta"
+ argType: DOUBLE
+ argIndex: 6
+ }
}
opList {
name: "lstsq"
- argDescriptor {
- name: "l2_factor"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -10890,6 +10886,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "l2_factor"
+ argType: DOUBLE
+ }
}
opList {
name: "lu"
@@ -10943,15 +10943,6 @@ opList {
}
opList {
name: "match_condition"
- argDescriptor {
- name: "compare"
- argType: DOUBLE
- }
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -10965,17 +10956,22 @@ opList {
argType: INPUT_TENSOR
}
argDescriptor {
- name: "mode"
+ name: "dimensions"
argType: INT64
}
+ argDescriptor {
+ name: "compare"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "match_condition_transform"
- argDescriptor {
- name: "compare"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -10992,19 +10988,14 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "compare"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
name: "matmul"
- argDescriptor {
- name: "alpha"
- argType: DOUBLE
- }
- argDescriptor {
- name: "beta"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -11050,9 +11041,6 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "matmul_bp"
argDescriptor {
name: "alpha"
argType: DOUBLE
@@ -11062,6 +11050,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "matmul_bp"
argDescriptor {
name: "dldx"
argType: OUTPUT_TENSOR
@@ -11113,6 +11104,15 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "alpha"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "beta"
+ argType: DOUBLE
+ argIndex: 1
+ }
}
opList {
name: "matrix_band_part"
@@ -11280,10 +11280,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -11338,6 +11334,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "max_scalar"
@@ -11441,10 +11441,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -11499,6 +11495,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "maxpool2d_bp"
@@ -11515,10 +11515,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -11573,6 +11569,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "maxpool3dnew"
@@ -11584,10 +11584,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -11662,6 +11658,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "maxpool3dnew_bp"
@@ -11678,10 +11678,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kD"
argType: INT64
@@ -11756,6 +11752,10 @@ opList {
argType: INT64
argIndex: 14
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "mean_pairwssqerr_loss"
@@ -12083,6 +12083,15 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
+ argDescriptor {
+ name: "input"
+ argType: INPUT_TENSOR
+ }
+ argDescriptor {
+ name: "y"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -12282,10 +12291,6 @@ opList {
}
opList {
name: "moments"
- argDescriptor {
- name: "keepDims"
- argType: DOUBLE
- }
argDescriptor {
name: "means"
argType: OUTPUT_TENSOR
@@ -12317,6 +12322,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "keepDims"
+ argType: DOUBLE
+ }
}
opList {
name: "mul_scalar"
@@ -12324,14 +12333,15 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "inPlace"
- argType: BOOL
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "y"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -12556,25 +12566,6 @@ opList {
}
opList {
name: "nadam_updater"
- argDescriptor {
- name: "dLr"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dBeta1"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "dBeta2"
- argType: DOUBLE
- argIndex: 2
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 3
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -12627,6 +12618,25 @@ opList {
name: "iteration"
argType: INT64
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dBeta1"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dBeta2"
+ argType: DOUBLE
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "dEpsilon"
+ argType: DOUBLE
+ argIndex: 3
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -12651,15 +12661,6 @@ opList {
}
opList {
name: "nesterovs_updater"
- argDescriptor {
- name: "dLr"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dMomentum"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -12688,6 +12689,15 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dMomentum"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -12696,14 +12706,14 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
}
opList {
name: "non_max_suppression"
@@ -12726,7 +12736,7 @@ opList {
argIndex: 2
}
argDescriptor {
- name: "iouThreshold"
+ name: "overlayThreshold"
argType: INPUT_TENSOR
argIndex: 3
}
@@ -12743,11 +12753,8 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "non_max_suppression_overlaps"
argDescriptor {
- name: "overlapThreshold"
+ name: "iouThreshold"
argType: DOUBLE
}
argDescriptor {
@@ -12755,6 +12762,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "non_max_suppression_overlaps"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -12768,21 +12778,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "maxOutSize"
- argType: INPUT_TENSOR
- argIndex: 2
- }
- argDescriptor {
- name: "iouThreshold"
- argType: INPUT_TENSOR
- argIndex: 3
- }
- argDescriptor {
- name: "scoreThreshold"
- argType: INPUT_TENSOR
- argIndex: 4
- }
argDescriptor {
name: "maxOutputSize"
argType: INT64
@@ -12791,6 +12786,15 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "overlapThreshold"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "scoreThreshold"
+ argType: DOUBLE
+ argIndex: 1
+ }
}
opList {
name: "non_max_suppression_v3"
@@ -12846,11 +12850,7 @@ opList {
opList {
name: "norm"
argDescriptor {
- name: "mode"
- argType: DOUBLE
- }
- argDescriptor {
- name: "*output"
+ name: "outputs"
argType: OUTPUT_TENSOR
}
argDescriptor {
@@ -12862,14 +12862,14 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "mode"
+ argType: DOUBLE
+ }
opDeclarationType: REDUCTION_OP_IMPL
}
opList {
name: "normalize_moments"
- argDescriptor {
- name: "shift"
- argType: DOUBLE
- }
argDescriptor {
name: "resMeans"
argType: OUTPUT_TENSOR
@@ -12907,13 +12907,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "shift"
+ argType: DOUBLE
+ }
}
opList {
name: "not"
- argDescriptor {
- name: "comparable"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -12931,6 +12931,10 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "comparable"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -13040,15 +13044,6 @@ opList {
}
opList {
name: "onehot"
- argDescriptor {
- name: "on"
- argType: DOUBLE
- }
- argDescriptor {
- name: "off"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13090,6 +13085,15 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "on"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "off"
+ argType: DOUBLE
+ argIndex: 1
+ }
}
opList {
name: "oneminus"
@@ -13132,14 +13136,14 @@ opList {
}
opList {
name: "or"
- argDescriptor {
- name: "comparable"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
}
+ argDescriptor {
+ name: "inPlace"
+ argType: BOOL
+ }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
@@ -13153,6 +13157,10 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "comparable"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -13188,10 +13196,6 @@ opList {
}
opList {
name: "pad"
- argDescriptor {
- name: "padValue"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13213,6 +13217,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "padValue"
+ argType: DOUBLE
+ }
}
opList {
name: "parallel_stack"
@@ -13236,20 +13244,6 @@ opList {
}
opList {
name: "percentile"
- argDescriptor {
- name: "q"
- argType: DOUBLE
- }
- argDescriptor {
- name: "interpolation"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "keepDims"
- argType: DOUBLE
- argIndex: 2
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13266,6 +13260,20 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "q"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "interpolation"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "keepDims"
+ argType: DOUBLE
+ argIndex: 2
+ }
}
opList {
name: "permute"
@@ -13318,10 +13326,6 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kY"
argType: INT64
@@ -13376,13 +13380,13 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "pnormpool2d_bp"
- argDescriptor {
- name: "eps"
- argType: DOUBLE
- }
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -13396,10 +13400,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -13454,6 +13454,14 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
+ argDescriptor {
+ name: "eps"
+ argType: DOUBLE
+ }
}
opList {
name: "pointwise_conv2d"
@@ -13528,10 +13536,6 @@ opList {
}
opList {
name: "pow"
- argDescriptor {
- name: "pow"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13549,6 +13553,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "pow"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -13704,10 +13712,6 @@ opList {
}
opList {
name: "probablistic_merge"
- argDescriptor {
- name: "probability"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13721,6 +13725,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "probability"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -13749,10 +13757,6 @@ opList {
}
opList {
name: "random_bernoulli"
- argDescriptor {
- name: "f"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13765,6 +13769,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "f"
+ argType: DOUBLE
+ }
}
opList {
name: "random_crop"
@@ -13792,10 +13800,6 @@ opList {
}
opList {
name: "random_exponential"
- argDescriptor {
- name: "lambda"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13808,6 +13812,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "lambda"
+ argType: DOUBLE
+ }
}
opList {
name: "random_gamma"
@@ -13919,6 +13927,14 @@ opList {
}
opList {
name: "randomnormal"
+ argDescriptor {
+ name: "outputs"
+ argType: OUTPUT_TENSOR
+ }
+ argDescriptor {
+ name: "shape"
+ argType: INPUT_TENSOR
+ }
argDescriptor {
name: "mean"
argType: DOUBLE
@@ -13928,26 +13944,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "outputs"
- argType: OUTPUT_TENSOR
- }
- argDescriptor {
- name: "shape"
- argType: INPUT_TENSOR
- }
}
opList {
name: "randomuniform"
- argDescriptor {
- name: "min"
- argType: DOUBLE
- }
- argDescriptor {
- name: "max"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -13970,27 +13969,27 @@ opList {
name: "dtype"
argType: INT64
}
+ argDescriptor {
+ name: "seed"
+ argType: INT64
+ argIndex: 1
+ }
argDescriptor {
name: "dataType"
argType: DATA_TYPE
}
-}
-opList {
- name: "range"
argDescriptor {
- name: "from"
+ name: "min"
argType: DOUBLE
}
argDescriptor {
- name: "to"
+ name: "max"
argType: DOUBLE
argIndex: 1
}
- argDescriptor {
- name: "step"
- argType: DOUBLE
- argIndex: 2
- }
+}
+opList {
+ name: "range"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -14027,6 +14026,20 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "from"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "to"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "step"
+ argType: DOUBLE
+ argIndex: 2
+ }
}
opList {
name: "rank"
@@ -14123,13 +14136,12 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
+ name: "inPlace"
+ argType: BOOL
}
argDescriptor {
- name: "y"
+ name: "input"
argType: INPUT_TENSOR
- argIndex: 1
}
opDeclarationType: LEGACY_XYZ
}
@@ -14332,10 +14344,6 @@ opList {
}
opList {
name: "reduce_logsumexp"
- argDescriptor {
- name: "keepDims"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -14361,6 +14369,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "keepDims"
+ argType: DOUBLE
+ }
}
opList {
name: "reduce_max"
@@ -14873,15 +14885,6 @@ opList {
}
opList {
name: "reduce_stdev"
- argDescriptor {
- name: "keepDims"
- argType: DOUBLE
- }
- argDescriptor {
- name: "biasCorrected"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -14899,9 +14902,6 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "reduce_stdev_bp"
argDescriptor {
name: "keepDims"
argType: DOUBLE
@@ -14911,6 +14911,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "reduce_stdev_bp"
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -14946,6 +14949,15 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "keepDims"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "biasCorrected"
+ argType: DOUBLE
+ argIndex: 1
+ }
}
opList {
name: "reduce_sum"
@@ -15010,15 +15022,6 @@ opList {
}
opList {
name: "reduce_variance"
- argDescriptor {
- name: "keepDims"
- argType: DOUBLE
- }
- argDescriptor {
- name: "biasCorrected"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -15036,9 +15039,6 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "reduce_variance_bp"
argDescriptor {
name: "keepDims"
argType: DOUBLE
@@ -15048,6 +15048,9 @@ opList {
argType: DOUBLE
argIndex: 1
}
+}
+opList {
+ name: "reduce_variance_bp"
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -15083,13 +15086,18 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "keepDims"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "biasCorrected"
+ argType: DOUBLE
+ argIndex: 1
+ }
}
opList {
name: "relu"
- argDescriptor {
- name: "cutoff"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -15102,14 +15110,14 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "relu6"
argDescriptor {
name: "cutoff"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "relu6"
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -15126,14 +15134,14 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "relu6_bp"
argDescriptor {
name: "cutoff"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "relu6_bp"
argDescriptor {
name: "gradI"
argType: OUTPUT_TENSOR
@@ -15147,14 +15155,14 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "cutoff"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
name: "relu_bp"
- argDescriptor {
- name: "scalar"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -15168,6 +15176,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "scalar"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -15227,13 +15239,12 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
+ name: "inPlace"
+ argType: BOOL
}
argDescriptor {
- name: "y"
+ name: "input"
argType: INPUT_TENSOR
- argIndex: 1
}
opDeclarationType: LEGACY_XYZ
}
@@ -15258,10 +15269,6 @@ opList {
}
opList {
name: "replace_nans"
- argDescriptor {
- name: "set"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -15274,6 +15281,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "set"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -15393,7 +15404,7 @@ opList {
argType: BOOL
}
argDescriptor {
- name: "halfPixelCenter"
+ name: "halfPixelCenters"
argType: BOOL
argIndex: 1
}
@@ -15843,20 +15854,6 @@ opList {
}
opList {
name: "rms_prop_updater"
- argDescriptor {
- name: "dLr"
- argType: DOUBLE
- }
- argDescriptor {
- name: "dRmsDecay"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "dEpsilon"
- argType: DOUBLE
- argIndex: 2
- }
argDescriptor {
name: "update"
argType: OUTPUT_TENSOR
@@ -15890,6 +15887,20 @@ opList {
argType: INPUT_TENSOR
argIndex: 4
}
+ argDescriptor {
+ name: "dLr"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "dRmsDecay"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "dEpsilon"
+ argType: DOUBLE
+ argIndex: 2
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -16439,10 +16450,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 2
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -16497,6 +16504,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "sconv2d_bp"
@@ -16538,10 +16549,6 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "kH"
argType: INT64
@@ -16596,6 +16603,10 @@ opList {
argType: INT64
argIndex: 10
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "segment_max"
@@ -16947,6 +16958,11 @@ opList {
name: "maxInd"
argType: INT64
}
+ argDescriptor {
+ name: "dataType"
+ argType: INT64
+ argIndex: 1
+ }
argDescriptor {
name: "dtype"
argType: DATA_TYPE
@@ -16958,14 +16974,15 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "inPlace"
- argType: BOOL
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "y"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
argDescriptor {
name: "dataType"
argType: DATA_TYPE
@@ -16978,14 +16995,15 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "inPlace"
- argType: BOOL
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "y"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -17009,15 +17027,6 @@ opList {
}
opList {
name: "setrange"
- argDescriptor {
- name: "min"
- argType: DOUBLE
- }
- argDescriptor {
- name: "max"
- argType: DOUBLE
- argIndex: 1
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -17034,6 +17043,15 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "min"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "max"
+ argType: DOUBLE
+ argIndex: 1
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -17054,10 +17072,6 @@ opList {
}
opList {
name: "sgd_updater"
- argDescriptor {
- name: "lr"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -17071,6 +17085,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "lr"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -17163,10 +17181,6 @@ opList {
}
opList {
name: "sigm_cross_entropy_loss"
- argDescriptor {
- name: "labelsSmoothing"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -17193,13 +17207,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "labelsSmoothing"
+ argType: DOUBLE
+ }
}
opList {
name: "sigm_cross_entropy_loss_grad"
- argDescriptor {
- name: "labelSmoothing"
- argType: DOUBLE
- }
argDescriptor {
name: "dLdp"
argType: OUTPUT_TENSOR
@@ -17236,6 +17250,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "labelSmoothing"
+ argType: DOUBLE
+ }
}
opList {
name: "sigmoid"
@@ -17519,6 +17537,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 3
}
+ argDescriptor {
+ name: "size"
+ argType: INT64
+ }
argDescriptor {
name: "dtype"
argType: DATA_TYPE
@@ -17571,10 +17593,6 @@ opList {
}
opList {
name: "softmax_cross_entropy_loss"
- argDescriptor {
- name: "labelsSmoothing"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -17601,13 +17619,13 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
-}
-opList {
- name: "softmax_cross_entropy_loss_grad"
argDescriptor {
name: "labelsSmoothing"
argType: DOUBLE
}
+}
+opList {
+ name: "softmax_cross_entropy_loss_grad"
argDescriptor {
name: "dLdp"
argType: OUTPUT_TENSOR
@@ -17644,6 +17662,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "labelsSmoothing"
+ argType: DOUBLE
+ }
}
opList {
name: "softmax_cross_entropy_loss_with_logits"
@@ -17823,10 +17845,6 @@ opList {
}
opList {
name: "solve_ls"
- argDescriptor {
- name: "l2_factor"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -17848,6 +17866,10 @@ opList {
name: "dtype"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "l2_factor"
+ argType: DOUBLE
+ }
}
opList {
name: "somepoolingpool2d"
@@ -17882,6 +17904,10 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
+ argDescriptor {
+ name: "inPlace"
+ argType: BOOL
+ }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
@@ -17895,16 +17921,6 @@ opList {
name: "blockSize"
argType: INT64
}
- argDescriptor {
- name: "paddingTop"
- argType: INT64
- argIndex: 1
- }
- argDescriptor {
- name: "paddingBottom"
- argType: INT64
- argIndex: 2
- }
argDescriptor {
name: "dtype"
argType: DATA_TYPE
@@ -18494,20 +18510,6 @@ opList {
}
opList {
name: "stabilize"
- argDescriptor {
- name: "realMin"
- argType: DOUBLE
- }
- argDescriptor {
- name: "cutOff"
- argType: DOUBLE
- argIndex: 1
- }
- argDescriptor {
- name: "k"
- argType: DOUBLE
- argIndex: 2
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -18524,6 +18526,20 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "realMin"
+ argType: DOUBLE
+ }
+ argDescriptor {
+ name: "cutOff"
+ argType: DOUBLE
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "k"
+ argType: DOUBLE
+ argIndex: 2
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -18728,7 +18744,7 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "biasCorrected"
+ name: "newFormat"
argType: BOOL
}
argDescriptor {
@@ -18748,10 +18764,6 @@ opList {
}
opList {
name: "step"
- argDescriptor {
- name: "cutoff"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -18764,6 +18776,10 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "cutoff"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
@@ -18906,13 +18922,12 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "input"
- argType: INPUT_TENSOR
+ name: "inPlace"
+ argType: BOOL
}
argDescriptor {
- name: "y"
+ name: "input"
argType: INPUT_TENSOR
- argIndex: 1
}
opDeclarationType: LEGACY_XYZ
}
@@ -19034,6 +19049,21 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
+ argDescriptor {
+ name: "s"
+ argType: INPUT_TENSOR
+ argIndex: 1
+ }
+ argDescriptor {
+ name: "u"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "v"
+ argType: INPUT_TENSOR
+ argIndex: 3
+ }
argDescriptor {
name: "fullUV"
argType: INT64
@@ -19079,10 +19109,6 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "frameName"
- argType: STRING
- }
argDescriptor {
name: "input"
argType: INPUT_TENSOR
@@ -19092,6 +19118,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "frameName"
+ argType: STRING
+ }
}
opList {
name: "tan"
@@ -19210,7 +19240,7 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "transposeX"
+ name: "addedEdges"
argType: BOOL
}
argDescriptor {
@@ -19395,10 +19425,6 @@ opList {
}
opList {
name: "thresholdedrelu"
- argDescriptor {
- name: "cutoff"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -19411,14 +19437,14 @@ opList {
name: "input"
argType: INPUT_TENSOR
}
- opDeclarationType: CONFIGURABLE_OP_IMPL
-}
-opList {
- name: "thresholdedrelu_bp"
argDescriptor {
name: "cutoff"
argType: DOUBLE
}
+ opDeclarationType: CONFIGURABLE_OP_IMPL
+}
+opList {
+ name: "thresholdedrelu_bp"
argDescriptor {
name: "dLdI"
argType: OUTPUT_TENSOR
@@ -19432,6 +19458,10 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "cutoff"
+ argType: DOUBLE
+ }
opDeclarationType: CONFIGURABLE_OP_IMPL
}
opList {
@@ -19727,10 +19757,6 @@ opList {
name: "outputs"
argType: OUTPUT_TENSOR
}
- argDescriptor {
- name: "dtype"
- argType: DATA_TYPE
- }
argDescriptor {
name: "row"
argType: INT64
@@ -19745,6 +19771,10 @@ opList {
argType: INT64
argIndex: 2
}
+ argDescriptor {
+ name: "dtype"
+ argType: DATA_TYPE
+ }
}
opList {
name: "triangular_solve"
@@ -19770,6 +19800,16 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "lower"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
+ argDescriptor {
+ name: "adjoint"
+ argType: INPUT_TENSOR
+ argIndex: 3
+ }
argDescriptor {
name: "dtype"
argType: DATA_TYPE
@@ -19903,6 +19943,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -19919,16 +19964,16 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "data"
+ name: "input"
argType: INPUT_TENSOR
}
argDescriptor {
- name: "segmentIds"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "gradient"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -19956,6 +20001,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -19972,16 +20022,16 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "data"
+ name: "input"
argType: INPUT_TENSOR
}
argDescriptor {
- name: "segmentIds"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "gradient"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -20009,6 +20059,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -20025,16 +20080,16 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "data"
+ name: "input"
argType: INPUT_TENSOR
}
argDescriptor {
- name: "segmentIds"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "gradient"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -20062,6 +20117,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -20082,12 +20142,12 @@ opList {
argType: INPUT_TENSOR
}
argDescriptor {
- name: "indices"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "eps"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -20115,6 +20175,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -20131,16 +20196,16 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "data"
+ name: "input"
argType: INPUT_TENSOR
}
argDescriptor {
- name: "segmentIds"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "gradient"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -20168,6 +20233,11 @@ opList {
argType: INPUT_TENSOR
argIndex: 1
}
+ argDescriptor {
+ name: "numSegments"
+ argType: INPUT_TENSOR
+ argIndex: 2
+ }
argDescriptor {
name: "numSegments"
argType: INT64
@@ -20184,16 +20254,16 @@ opList {
argType: OUTPUT_TENSOR
}
argDescriptor {
- name: "data"
+ name: "input"
argType: INPUT_TENSOR
}
argDescriptor {
- name: "segmentIds"
+ name: "idxSegments"
argType: INPUT_TENSOR
argIndex: 1
}
argDescriptor {
- name: "gradient"
+ name: "numSegments"
argType: INPUT_TENSOR
argIndex: 2
}
@@ -20464,10 +20534,6 @@ opList {
}
opList {
name: "xor"
- argDescriptor {
- name: "comparable"
- argType: DOUBLE
- }
argDescriptor {
name: "outputs"
argType: OUTPUT_TENSOR
@@ -20485,6 +20551,10 @@ opList {
name: "dataType"
argType: DATA_TYPE
}
+ argDescriptor {
+ name: "comparable"
+ argType: DOUBLE
+ }
opDeclarationType: LEGACY_XYZ
}
opList {
diff --git a/deeplearning4j/deeplearning4j-core/pom.xml b/deeplearning4j/deeplearning4j-core/pom.xml
index 27caa6718..6efc26d34 100644
--- a/deeplearning4j/deeplearning4j-core/pom.xml
+++ b/deeplearning4j/deeplearning4j-core/pom.xml
@@ -163,6 +163,12 @@
oshi-core
${oshi.version}
+
+ org.nd4j
+ nd4j-native
+ ${project.version}
+ test
+
diff --git a/deeplearning4j/deeplearning4j-core/src/test/java/org/deeplearning4j/gradientcheck/CNN1DGradientCheckTest.java b/deeplearning4j/deeplearning4j-core/src/test/java/org/deeplearning4j/gradientcheck/CNN1DGradientCheckTest.java
index c4c85efc3..6151c4099 100644
--- a/deeplearning4j/deeplearning4j-core/src/test/java/org/deeplearning4j/gradientcheck/CNN1DGradientCheckTest.java
+++ b/deeplearning4j/deeplearning4j-core/src/test/java/org/deeplearning4j/gradientcheck/CNN1DGradientCheckTest.java
@@ -64,7 +64,7 @@ public class CNN1DGradientCheckTest extends BaseDL4JTest {
@Override
public long getTimeoutMilliseconds() {
- return 90000L;
+ return 180000;
}
@Test
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/pom.xml b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/pom.xml
deleted file mode 100644
index 4d9f02d37..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/pom.xml
+++ /dev/null
@@ -1,70 +0,0 @@
-
-
-
-
-
- 4.0.0
-
-
- org.deeplearning4j
- deeplearning4j-nlp-parent
- 1.0.0-SNAPSHOT
-
-
- org.deeplearning4j
- deeplearning4j-nlp-chinese
- 1.0.0-SNAPSHOT
-
-
- 1.6.4
- 0.9.28
- 1.7.2
-
-
-
-
- junit
- junit
-
-
- org.deeplearning4j
- deeplearning4j-nlp
- ${project.version}
-
-
- org.nlpcn
- nlp-lang
- ${nlp-lang.version}
- compile
-
-
-
-
-
- test-nd4j-native
-
-
- test-nd4j-cuda-11.0
-
-
-
\ No newline at end of file
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Config.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Config.java
deleted file mode 100644
index b53cddafb..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Config.java
+++ /dev/null
@@ -1,251 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf;
-
-import org.ansj.app.crf.pojo.Element;
-import org.nlpcn.commons.lang.util.WordAlert;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class Config {
-
- public String splitStr = "\\s+";
-
- public Config(int[][] template) {
- this.template = template;
- }
-
- public static final int TAG_NUM = 4; // 标记类型写死了4个
-
- // 特殊字符的标注
- public static final char BEGIN = 128;
-
- public static final char END = 129;
-
- public static final char NUM_BEGIN = 130;
-
- public static final char EN_BEGIN = 140;
-
- public static final char FEATURE_BEGIN = 150;
-
- public static char getNum(String str) {
- if (str.length() > 9) {
- return NUM_BEGIN;
- } else {
- return (char) (NUM_BEGIN + str.length());
- }
- }
-
- public static char getEn(String str) {
- if (str.length() > 9) {
- return EN_BEGIN;
- } else {
- return (char) (EN_BEGIN + str.length());
- }
-
- }
-
- // 字标注类型
- public static int S = 0;
- public static int B = 1;
- public static int M = 2;
- public static int E = 3;
-
- private int[][] template = {{-2}, {-1}, {0}, {1}, {2}, {-2, -1}, {-1, 0}, {0, 1}, {1, 2}, {-1, 1}};
-
- public int[][] getTemplate() {
- return template;
- }
-
- public void setTemplate(int[][] template) {
- this.template = template;
- }
-
- /**
- * 词语标准化
- *
- * @param word
- * @return
- */
- public static List wordAlert(String word) {
-
- char[] chars = WordAlert.alertStr(word);
-
- List list = new ArrayList<>();
-
- StringBuilder tempSb = new StringBuilder();
-
- int status = 0; // 1 num 2 english
-
- Element element = null;
-
- for (int i = 0; i < chars.length; i++) {
-
- if (chars[i] >= '0' && chars[i] <= '9') {
- if (status == 2) {
- element = new Element(Config.getNum(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- tempSb = new StringBuilder();
- }
- tempSb.append(chars[i]);
- status = 1;
- } else if (chars[i] >= 'A' && chars[i] <= 'z') {
- if (status == 1) {
- element = new Element(Config.getEn(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- tempSb = new StringBuilder();
- }
- tempSb.append(chars[i]);
- status = 2;
- } else {
- if (status == 1) {
- element = new Element(Config.getNum(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- } else if (status == 2) {
- element = new Element(Config.getEn(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- }
- tempSb = new StringBuilder();
- list.add(new Element(chars[i]));
- status = 0;
- }
-
- }
-
- if (tempSb.length() > 0) {
- if (status == 1) {
- element = new Element(Config.getNum(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- } else if (status == 2) {
- element = new Element(Config.getEn(tempSb.toString()));
- element.len = tempSb.length();
- list.add(element);
- } else {
- System.out.println("err!");
- }
- }
-
- return list;
- }
-
- /**
- * @param temp
- * @return
- */
- public static List makeToElementList(String temp, String splitStr) {
- String[] split = temp.split(splitStr);
- List list = new ArrayList<>(temp.length());
-
- for (String word : split) {
-
- List wordAlert = wordAlert(word);
-
- int len = wordAlert.size();
-
- if (len == 1) {
- wordAlert.get(0).updateTag(Config.S);
- } else if (len == 2) {
- wordAlert.get(0).updateTag(Config.B);
- wordAlert.get(1).updateTag(Config.E);
- } else if (len > 2) {
- wordAlert.get(0).updateTag(Config.B);
- for (int i = 1; i < len - 1; i++) {
- wordAlert.get(i).updateTag(Config.M);
- }
- wordAlert.get(len - 1).updateTag(Config.E);
- }
-
- list.addAll(wordAlert);
- }
- return list;
- }
-
- public List makeToElementList(String temp) {
- return wordAlert(temp);
- }
-
- public char getNameIfOutArr(List list, int index) {
- if (index < 0) {
- return Config.BEGIN;
- } else if (index >= list.size()) {
- return Config.END;
- } else {
- return list.get(index).name;
- }
- }
-
- public char getTagIfOutArr(List list, int index) {
- if (index < 0 || index >= list.size()) {
- return 0;
- } else {
- return (char) list.get(index).getTag();
- }
- }
-
- /**
- * 得到一个位置的所有特征
- *
- * @param list
- * @param index
- * @return KeyValue(词语,featureLength*tagNum)
- */
- public char[][] makeFeatureArr(List list, int index) {
- char[][] result = new char[template.length][];
- char[] chars = null;
- int len = 0;
- int i = 0;
- for (; i < template.length; i++) {
- if (template[i].length == 0) {
- continue;
- }
- chars = new char[template[i].length + 1];
- len = chars.length - 1;
- for (int j = 0; j < len; j++) {
- chars[j] = getNameIfOutArr(list, index + template[i][j]);
- }
- chars[len] = (char) (FEATURE_BEGIN + i);
- result[i] = chars;
- }
-
- return result;
- }
-
- public static char getTagName(int tag) {
- switch (tag) {
- case 0:
- return 'S';
- case 1:
- return 'B';
- case 2:
- return 'M';
- case 3:
- return 'E';
- default:
- return '?';
- }
- }
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/MakeTrainFile.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/MakeTrainFile.java
deleted file mode 100644
index 4700b928b..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/MakeTrainFile.java
+++ /dev/null
@@ -1,81 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf;
-
-import org.ansj.app.crf.pojo.Element;
-import org.nlpcn.commons.lang.util.IOUtil;
-import org.nlpcn.commons.lang.util.StringUtil;
-import org.nlpcn.commons.lang.util.logging.Log;
-import org.nlpcn.commons.lang.util.logging.LogFactory;
-
-import java.io.BufferedReader;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.List;
-
-public class MakeTrainFile {
-
- private static final Log logger = LogFactory.getLog();
-
- public static void main(String[] args) {
-
- String inputPath = "corpus.txt";
-
- String outputPath = "train.txt";
-
- if (args != null && args.length == 2) {
- inputPath = args[0];
- outputPath = args[1];
- }
-
- if (StringUtil.isBlank(inputPath) || StringUtil.isBlank(outputPath)) {
- logger.info("org.ansj.app.crf.MakeTrainFile [inputPath] [outputPath]");
- return;
- }
- try (BufferedReader reader = IOUtil.getReader(inputPath, "utf-8");
- FileOutputStream fos = new FileOutputStream(outputPath)) {
- String temp = null;
- int i = 0;
- while ((temp = reader.readLine()) != null) {
- StringBuilder sb = new StringBuilder("\n");
- if (StringUtil.isBlank(temp)) {
- continue;
- }
- if (i == 0) {
- temp = StringUtil.trim(temp);
- }
- List list = Config.makeToElementList(temp, "\\s+");
- for (Element element : list) {
- sb.append(element.nameStr() + " " + Config.getTagName(element.getTag()));
- sb.append("\n");
- }
- fos.write(sb.toString().getBytes(IOUtil.UTF8));
- System.out.println(++i);
- }
- } catch (FileNotFoundException e) {
- logger.warn("文件没有找到", e);
- } catch (IOException e) {
- logger.warn("IO异常", e);
- }
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Model.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Model.java
deleted file mode 100644
index b2caa5e1f..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/Model.java
+++ /dev/null
@@ -1,196 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf;
-
-import org.ansj.app.crf.model.CRFModel;
-import org.ansj.app.crf.model.CRFppTxtModel;
-import org.ansj.app.crf.model.WapitiCRFModel;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.MapCount;
-import org.nlpcn.commons.lang.util.logging.Log;
-import org.nlpcn.commons.lang.util.logging.LogFactory;
-
-import java.io.*;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.zip.GZIPOutputStream;
-
-public abstract class Model {
-
- public static final Log logger = LogFactory.getLog(Model.class);
-
- protected Config config;
-
- protected SmartForest featureTree = null;
-
- protected float[][] status = new float[Config.TAG_NUM][Config.TAG_NUM];
-
- public int allFeatureCount = 0;
-
- /**
- * 判断当前数据流是否是本实例
- *
- * @param is
- * @return
- */
- public abstract boolean checkModel(String modelPath) throws IOException;
-
- /**
- * 模型读取
- *
- * @param path
- * @return
- * @return
- * @throws Exception
- */
- public static Model load(String modelPath) throws Exception {
- Model model = new CRFModel();
- if (model.checkModel(modelPath)) {
- return model.loadModel(modelPath);
- }
- model = new CRFppTxtModel();
-
- if (model.checkModel(modelPath)) {
- return model.loadModel(modelPath);
- }
- model = new WapitiCRFModel();
- if (model.checkModel(modelPath)) {
- return model.loadModel(modelPath);
- }
- throw new Exception("I did not know what type of model by file " + modelPath);
- }
-
- /**
- * 模型读取
- *
- */
- public static Model load(Class extends Model> modelClass, InputStream inputStream) throws Exception {
- return modelClass
- .getDeclaredConstructor()
- .newInstance()
- .loadModel(inputStream);
- }
-
- /**
- * 不同的模型实现自己的加载模型类
- *
- * @throws Exception
- */
- public abstract Model loadModel(String modelPath) throws Exception;
-
- public abstract Model loadModel(InputStream is) throws Exception;
-
- /**
- * 获得特征所在权重数组
- *
- * @param featureStr
- * @return
- */
- public float[] getFeature(char... chars) {
- if (chars == null) {
- return null;
- }
- SmartForest sf = featureTree;
- sf = sf.getBranch(chars);
- if (sf == null || sf.getParam() == null) {
- return null;
- }
- return sf.getParam();
- }
-
- public Config getConfig() {
- return this.config;
- }
-
- /**
- * tag转移率
- *
- * @param s1
- * @param s2
- * @return
- */
- public float tagRate(int s1, int s2) {
- return status[s1][s2];
- }
-
- /**
- * 增加特征到特征数中
- *
- * @param cs
- * @param tempW
- */
- protected static void printFeatureTree(String cs, float[] tempW) {
- String name = "*";
- if (tempW.length == 4) {
- name = "U";
- }
- name += "*" + (cs.charAt(cs.length() - 1) - Config.FEATURE_BEGIN + 1) + ":" + cs.substring(0, cs.length() - 1);
- for (int i = 0; i < tempW.length; i++) {
- if (tempW[i] != 0) {
- System.out.println(name + "\t" + Config.getTagName(i / 4 - 1) + "\t" + Config.getTagName(i % 4) + "\t"
- + tempW[i]);
- }
-
- }
- }
-
- /**
- * 将model序列化到硬盘
- *
- * @param path
- * @throws IOException
- * @throws FileNotFoundException
- */
- public void writeModel(String path) {
- try (FileOutputStream fso = new FileOutputStream(path)) {
- ObjectOutputStream oos = new ObjectOutputStream(new GZIPOutputStream(fso));
- oos.writeUTF(CRFModel.VERSION);
- oos.writeObject(status);
- oos.writeObject(config.getTemplate());
- Map map = featureTree.toMap();
- MapCount mc = new MapCount<>();
- for (float[] v : map.values()) {
- mc.add(v.length);
- }
- for (Entry entry : mc.get().entrySet()) {
- int win = entry.getKey();
- oos.writeInt(win);// 宽度
- oos.writeInt(entry.getValue().intValue());// 个数
- for (Entry e : map.entrySet()) {
- if (e.getValue().length == win) {
- oos.writeUTF(e.getKey());
- float[] value = e.getValue();
- for (int i = 0; i < win; i++) {
- oos.writeFloat(value[i]);
- }
- }
- }
- }
- oos.writeInt(0);
- oos.writeInt(0);
- oos.flush();
- } catch (FileNotFoundException e) {
- logger.warn("文件没有找到", e);
- } catch (IOException e) {
- logger.warn("IO异常", e);
- }
- }
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/SplitWord.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/SplitWord.java
deleted file mode 100644
index 2d3e69a9a..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/SplitWord.java
+++ /dev/null
@@ -1,192 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf;
-
-import org.ansj.app.crf.pojo.Element;
-import org.ansj.util.MatrixUtil;
-import org.nlpcn.commons.lang.util.StringUtil;
-
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
-/**
- * 分词
- *
- * @author ansj
- *
- */
-public class SplitWord {
-
- private Model model = null;
-
- public SplitWord(Model model) {
- this.model = model;
- };
-
- public List cut(char[] chars) {
- return cut(new String(chars));
- }
-
- public List cut(String line) {
-
- if (StringUtil.isBlank(line)) {
- return Collections.emptyList();
- }
-
- List elements = vterbi(line);
-
- List result = new ArrayList<>();
-
- Element e = null;
- int begin = 0;
- int end = 0;
- int size = elements.size() - 1;
- for (int i = 0; i < elements.size(); i++) {
- e = elements.get(i);
- switch (e.getTag()) {
- case 0:
- end += e.len;
- result.add(line.substring(begin, end));
- begin = end;
- break;
- case 1:
- end += e.len;
- while (i < size && (e = elements.get(++i)).getTag() != 3) {
- end += e.len;
- }
- end += e.len;
- result.add(line.substring(begin, end));
- begin = end;
- default:
- break;
- }
- }
- return result;
- }
-
- private List vterbi(String line) {
- List elements = Config.wordAlert(line);
-
- int length = elements.size();
-
- if (length == 0) { // 避免空list,下面get(0)操作越界
- return elements;
- }
- if (length == 1) {
- elements.get(0).updateTag(0);
- return elements;
- }
-
- /**
- * 填充图
- */
- for (int i = 0; i < length; i++) {
- computeTagScore(elements, i);
- }
-
- // 如果是开始不可能从 m,e开始 ,所以将它设为一个很小的值
- elements.get(0).tagScore[2] = -1000;
- elements.get(0).tagScore[3] = -1000;
-
- for (int i = 1; i < length; i++) {
- elements.get(i).maxFrom(model, elements.get(i - 1));
- }
-
- // 末位置只能从S,E开始
- // 末位置只能从0,3开始
-
- Element next = elements.get(elements.size() - 1);
-
- Element self = null;
-
- int maxStatus = next.tagScore[0] > next.tagScore[3] ? 0 : 3;
-
- next.updateTag(maxStatus);
-
- maxStatus = next.from[maxStatus];
-
- // 逆序寻找
- for (int i = elements.size() - 2; i > 0; i--) {
- self = elements.get(i);
- self.updateTag(maxStatus);
- maxStatus = self.from[self.getTag()];
- next = self;
- }
- elements.get(0).updateTag(maxStatus);
-
- // printElements(elements) ;
-
- return elements;
-
- }
-
- private void computeTagScore(List elements, int index) {
-
- char[][] feautres = model.getConfig().makeFeatureArr(elements, index);
-
- //TODO: set 20 很大吧!
- float[] tagScore = new float[20]; //Config.TAG_NUM*Config.TAG_NUM+Config.TAG_NUM
-
- for (int i = 0; i < feautres.length; i++) {
- MatrixUtil.dot(tagScore, model.getFeature(feautres[i]));
- }
-
- elements.get(index).tagScore = tagScore;
- }
-
- /**
- * 随便给一个词。计算这个词的内聚分值,可以理解为计算这个词的可信度
- *
- * @param word
- */
- public float cohesion(String word) {
-
- if (word.length() == 0) {
- return Integer.MIN_VALUE;
- }
-
- List elements = Config.wordAlert(word);
-
- for (int i = 0; i < elements.size(); i++) {
- computeTagScore(elements, i);
- }
-
- float value = elements.get(0).tagScore[1];
-
- int len = elements.size() - 1;
-
- for (int i = 1; i < len; i++) {
- value += elements.get(i).tagScore[2];
- }
-
- value += elements.get(len).tagScore[3];
-
- if (value < 0) {
- return 1;
- } else {
- value += 1;
- }
-
- return value;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFModel.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFModel.java
deleted file mode 100644
index 4a1886fed..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFModel.java
+++ /dev/null
@@ -1,92 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf.model;
-
-import org.ansj.app.crf.Config;
-import org.ansj.app.crf.Model;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.IOUtil;
-
-import java.io.*;
-import java.util.zip.GZIPInputStream;
-import java.util.zip.ZipException;
-
-public class CRFModel extends Model {
-
- public static final String VERSION = "ansj1";
-
- @Override
- public CRFModel loadModel(String modelPath) throws Exception {
- try (InputStream is = IOUtil.getInputStream(modelPath)) {
- loadModel(is);
- return this;
- }
- }
-
- @Override
- public CRFModel loadModel(InputStream is) throws Exception {
- long start = System.currentTimeMillis();
- try (ObjectInputStream ois = new ObjectInputStream(new GZIPInputStream(is))) {
- ois.readUTF();
- this.status = (float[][]) ois.readObject();
- int[][] template = (int[][]) ois.readObject();
- this.config = new Config(template);
- int win = 0;
- int size = 0;
- String name = null;
- featureTree = new SmartForest();
- float[] value = null;
- do {
- win = ois.readInt();
- size = ois.readInt();
- for (int i = 0; i < size; i++) {
- name = ois.readUTF();
- value = new float[win];
- for (int j = 0; j < value.length; j++) {
- value[j] = ois.readFloat();
- }
- featureTree.add(name, value);
- }
- } while (win == 0 || size == 0);
- logger.info("load crf model ok ! use time :" + (System.currentTimeMillis() - start));
- }
- return this;
- }
-
- @Override
- public boolean checkModel(String modelPath) {
- try (FileInputStream fis = new FileInputStream(modelPath)) {
- ObjectInputStream inputStream = new ObjectInputStream(new GZIPInputStream(fis));
- String version = inputStream.readUTF();
- if (version.equals("ansj1")) { // 加载ansj,model
- return true;
- }
- } catch (ZipException ze) {
- logger.warn("解压异常", ze);
- } catch (FileNotFoundException e) {
- logger.warn("文件没有找到", e);
- } catch (IOException e) {
- logger.warn("IO异常", e);
- }
- return false;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFppTxtModel.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFppTxtModel.java
deleted file mode 100644
index f0eb5485c..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/CRFppTxtModel.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf.model;
-
-import org.ansj.app.crf.Config;
-import org.ansj.app.crf.Model;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.IOUtil;
-import org.nlpcn.commons.lang.util.ObjConver;
-import org.nlpcn.commons.lang.util.StringUtil;
-import org.nlpcn.commons.lang.util.tuples.Pair;
-
-import java.io.BufferedReader;
-import java.io.FileInputStream;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-
-public class CRFppTxtModel extends Model {
-
- /**
- * 解析crf++生成的可可视txt文件
- *
- * @return
- */
- @Override
- public CRFppTxtModel loadModel(String modelPath) throws Exception {
- try (InputStream is = new FileInputStream(modelPath)) {
- loadModel(new FileInputStream(modelPath));
- return this;
- }
- }
-
- @Override
- public Model loadModel(InputStream is) throws Exception {
- long start = System.currentTimeMillis();
-
- BufferedReader reader = IOUtil.getReader(is, IOUtil.UTF8);
-
- reader.readLine();// version
- reader.readLine();// cost-factor
-
- // int maxId =
- // Integer.parseInt(reader.readLine().split(":")[1].trim());// read
- reader.readLine();// xsize
- reader.readLine(); // line
- int[] statusCoven = loadTagCoven(reader);
- Map featureIndex = loadConfig(reader);
- StringBuilder sb = new StringBuilder();
- for (int[] t1 : config.getTemplate()) {
- sb.append(Arrays.toString(t1) + " ");
- }
- logger.info("load template ok template : " + sb);
- TreeMap> featureNames = loadFeatureName(featureIndex, reader);
- logger.info("load feature ok feature size : " + featureNames.size());
- loadFeatureWeight(reader, statusCoven, featureNames);
- logger.info("load crfpp model ok ! use time : " + (System.currentTimeMillis() - start));
- return this;
- }
-
- /**
- * 加载特征值 //11:*6:_x-1/的,
- *
- * @param maxId
- *
- * @param featureIndex
- *
- * @param br
- * @return
- * @throws Exception
- */
-
- private TreeMap> loadFeatureName(Map featureIndex, BufferedReader br)
- throws Exception {
-
- TreeMap> featureNames = new TreeMap<>();
-
- String temp = null;
- while (StringUtil.isNotBlank(temp = br.readLine())) {
-
- int indexOf = temp.indexOf(" ");
-
- int id = ObjConver.getIntValue(temp.substring(0, indexOf));
-
- if (indexOf > 0) {
- temp = temp.substring(indexOf);
- }
-
- String[] split = temp.split(":");
-
- if (split.length == 1) {
- featureNames.put(id, Pair.with(temp.trim(), ""));
- } else {
- String name = split[1];
- if (split.length > 2) {
- for (int j = 2; j < split.length; j++) {
- name += ":" + split[j];
- }
- }
-
- int lastFeatureId = featureIndex.get(split[0].trim());
-
- if ("/".equals(name)) {
- name = "//";
- }
-
- if (name.contains("//")) {
- name = name.replaceAll("//", "/XIEGANG/");
- }
- String featureName = toFeatureName(name.trim().split("/"), lastFeatureId);
-
- featureNames.put(id, Pair.with(split[0].trim(), featureName));
-
- }
-
- }
-
- return featureNames;
-
- }
-
- private String toFeatureName(String[] split, int lastFeatureId) throws Exception {
-
- StringBuilder result = new StringBuilder();
-
- for (String str : split) {
- if ("".equals(str)) {
- continue;
- } else if (str.length() == 1) {
- result.append(str.charAt(0));
- } else if (str.equals("XIEGANG")) {
- result.append('/');
- } else if (str.startsWith("num")) {
- result.append((char) (Config.NUM_BEGIN + ObjConver.getIntValue(str.replace("num", ""))));
- } else if (str.startsWith("en")) {
- result.append((char) (Config.EN_BEGIN + ObjConver.getIntValue(str.replace("en", ""))));
- } else if (str.startsWith("_B-")) {
- result.append(Config.BEGIN);
- } else if (str.startsWith("_B+")) {
- result.append(Config.END);
- } else {
- throw new Exception("can find feature named " + str + " in " + Arrays.toString(split));
- }
- }
-
- result.append((char) (lastFeatureId + Config.FEATURE_BEGIN));
-
- return result.toString();
- }
-
- /**
- * 加载特征权重
- *
- * @param br
- * @param featureNames
- * @param statusCoven
- * @throws Exception
- */
- private void loadFeatureWeight(BufferedReader br, int[] statusCoven,
- TreeMap> featureNames) throws Exception {
-
- featureTree = new SmartForest();
-
- int tag = 0; // 赏析按标签为用来转换
-
- int len = 0; // 权重数组的大小
-
- String name = null; // 特征名称
-
- float[] tempW = null; // 每一个特征的权重
-
- String temp = null;
-
- for (Pair pair : featureNames.values()) {
-
- char fc = Character.toUpperCase(pair.getValue0().charAt(0));
-
- len = fc == 'B' ? Config.TAG_NUM * Config.TAG_NUM
- : fc == 'U' ? Config.TAG_NUM
- : fc == '*' ? (Config.TAG_NUM + Config.TAG_NUM * Config.TAG_NUM) : 0;
-
- if (len == 0) {
- throw new Exception("unknow feature type " + pair.getValue0());
- }
-
- if (fc == 'B') { // 特殊处理转换特征数组
- for (int i = 0; i < len; i++) {
- temp = br.readLine();
- int from = statusCoven[i / Config.TAG_NUM];
- int to = statusCoven[i % Config.TAG_NUM];
- status[from][to] = ObjConver.getFloatValue(temp);
- }
-
- } else {
-
- name = pair.getValue1();
-
- tempW = new float[len];
-
- for (int i = 0; i < len; i++) {
- temp = br.readLine();
- tag = statusCoven[i];
- tempW[tag] = ObjConver.getFloatValue(temp);
- }
- this.featureTree.add(name, tempW); // 将特征增加到特征🌲中
-
- // printFeatureTree(name, tempW);
- }
-
- }
-
- }
-
- /**
- * 加载特征标签转换
- *
- * @param br
- * @return
- * @throws Exception
- */
- private int[] loadTagCoven(BufferedReader br) throws Exception {
-
- int[] conver = new int[Config.TAG_NUM + Config.TAG_NUM * Config.TAG_NUM];
-
- String temp = null;
-
- // TODO: 这个是个写死的过程,如果标签发生改变需要重新来写这里
- for (int i = 0; i < Config.TAG_NUM; i++) {
- String line = br.readLine();
- if (StringUtil.isBlank(line)) {
- i--;
- continue;
- }
-
- char c = line.charAt(0);
- switch (c) {
- case 'S':
- conver[i] = Config.S;
- break;
- case 'B':
- conver[i] = Config.B;
- break;
- case 'M':
- conver[i] = Config.M;
- break;
- case 'E':
- conver[i] = Config.E;
- break;
- default:
- throw new Exception("err tag named " + c + " in model " + temp);
- }
- }
-
- for (int i = Config.TAG_NUM; i < conver.length; i++) {
- conver[i] = conver[(i - 4) / Config.TAG_NUM] * Config.TAG_NUM + conver[i % Config.TAG_NUM] + Config.TAG_NUM;
- }
-
- return conver;
- }
-
- private Map loadConfig(BufferedReader br) throws IOException {
-
- Map featureIndex = new HashMap<>();
-
- String temp = br.readLine();// #rdr#8/0/0
-
- List list = new ArrayList<>();
-
- while (StringUtil.isNotBlank((temp = br.readLine()))) {
-
- List matcherAll = StringUtil.matcherAll("\\[.*?\\]", temp);
-
- if (matcherAll.isEmpty()) {
- continue;
- }
-
- int[] is = new int[matcherAll.size()];
- for (int j = 0; j < is.length; j++) {
- is[j] = ObjConver.getIntValue(StringUtil.matcherFirst("[-\\d]+", matcherAll.get(j)));
- }
-
- featureIndex.put(temp.split(":")[0].trim(), list.size());
-
- list.add(is);
- }
-
- int[][] template = new int[list.size()][0]; // 构建特征模板
-
- for (int i = 0; i < template.length; i++) {
- template[i] = list.get(i);
- }
-
- config = new Config(template);
-
- return featureIndex;
- }
-
- @Override
- public boolean checkModel(String modelPath) {
-
- try (InputStream is = IOUtil.getInputStream(modelPath)) {
- byte[] bytes = new byte[100];
- is.read(bytes);
- String string = new String(bytes);
- if (string.startsWith("version")) { // 加载crf++ 的txt类型的modle
- return true;
- }
- } catch (IOException e) {
- logger.warn("IO异常", e);
- }
- return false;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/WapitiCRFModel.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/WapitiCRFModel.java
deleted file mode 100644
index 0a2742b07..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/model/WapitiCRFModel.java
+++ /dev/null
@@ -1,360 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf.model;
-
-import org.ansj.app.crf.Config;
-import org.ansj.app.crf.Model;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.IOUtil;
-import org.nlpcn.commons.lang.util.ObjConver;
-import org.nlpcn.commons.lang.util.StringUtil;
-import org.nlpcn.commons.lang.util.tuples.Pair;
-
-import java.io.BufferedReader;
-import java.io.IOException;
-import java.io.InputStream;
-import java.util.*;
-
-public class WapitiCRFModel extends Model {
-
- @Override
- public WapitiCRFModel loadModel(String modelPath) throws Exception {
- try (InputStream is = IOUtil.getInputStream(modelPath)) {
- return loadModel(is);
- }
- }
-
- @Override
- public WapitiCRFModel loadModel(InputStream is) throws Exception {
- BufferedReader br = IOUtil.getReader(is, IOUtil.UTF8);
-
- long start = System.currentTimeMillis();
-
- logger.info("load wapiti model begin!");
-
- String temp = br.readLine();
-
- logger.info(temp); // #mdl#2#123
-
- Map featureIndex = loadConfig(br);
-
- StringBuilder sb = new StringBuilder();
- for (int[] t1 : config.getTemplate()) {
- sb.append(Arrays.toString(t1) + " ");
- }
-
- logger.info("featureIndex is " + featureIndex);
- logger.info("load template ok template : " + sb);
-
- int[] statusCoven = loadTagCoven(br);
-
- List> loadFeatureName = loadFeatureName(featureIndex, br);
-
- logger.info("load feature ok feature size : " + loadFeatureName.size());
-
- featureTree = new SmartForest();
-
- loadFeatureWeight(br, statusCoven, loadFeatureName);
-
- logger.info("load wapiti model ok ! use time :" + (System.currentTimeMillis() - start));
- return this;
- }
-
- /**
- * 加载特征权重
- *
- * @param br
- * @param featureNames
- * @param statusCoven
- * @throws Exception
- */
- private void loadFeatureWeight(BufferedReader br, int[] statusCoven, List> featureNames)
- throws Exception {
-
- int key = 0;
-
- int offe = 0;
-
- int tag = 0; // 赏析按标签为用来转换
-
- int len = 0; // 权重数组的大小
-
- int min, max = 0; // 设置边界
-
- String name = null; // 特征名称
-
- float[] tempW = null; // 每一个特征的权重
-
- String temp = br.readLine();
-
- for (Pair pair : featureNames) {
-
- if (temp == null) {
- logger.warn(pair.getValue0() + "\t" + pair.getValue1() + " not have any weight ,so skip it !");
- continue;
- }
-
- char fc = Character.toUpperCase(pair.getValue0().charAt(0));
-
- len = fc == 'B' ? Config.TAG_NUM * Config.TAG_NUM
- : fc == 'U' ? Config.TAG_NUM
- : fc == '*' ? (Config.TAG_NUM + Config.TAG_NUM * Config.TAG_NUM) : 0;
-
- if (len == 0) {
- throw new Exception("unknow feature type " + pair.getValue0());
- }
-
- min = max;
- max += len;
- if (fc == 'B') { // 特殊处理转换特征数组
- for (int i = 0; i < len; i++) {
- String[] split = temp.split("=");
- int from = statusCoven[i / Config.TAG_NUM];
- int to = statusCoven[i % Config.TAG_NUM];
- status[from][to] = ObjConver.getFloatValue(split[1]);
- temp = br.readLine();
- }
- } else {
-
- name = pair.getValue1();
-
- tempW = new float[len];
-
- do {
- String[] split = temp.split("=");
-
- key = ObjConver.getIntValue(split[0]);
-
- if (key >= max) { // 如果超过边界那么跳出
- break;
- }
-
- offe = key - min;
-
- tag = statusCoven[offe];
-
- tempW[tag] = ObjConver.getFloatValue(split[1]);
-
- } while ((temp = br.readLine()) != null);
-
- this.featureTree.add(name, tempW); // 将特征增加到特征🌲中
-
- // printFeatureTree(name, tempW);
- }
-
- }
-
- }
-
- /**
- * 加载特征值 //11:*6:_x-1/的,
- *
- * @param featureIndex
- *
- * @param br
- * @return
- * @throws Exception
- */
-
- private List> loadFeatureName(Map featureIndex, BufferedReader br)
- throws Exception {
- String temp = br.readLine();// #qrk#num
- int featureNum = ObjConver.getIntValue(StringUtil.matcherFirst("\\d+", temp)); // 找到特征个数
-
- List> featureNames = new ArrayList<>();
-
- for (int i = 0; i < featureNum; i++) {
- temp = br.readLine();
-
- String[] split = temp.split(":");
-
- if (split.length == 2) {
- featureNames.add(Pair.with(split[1], ""));
- continue;
- } else {
-
- String name = split[2];
-
- if (split.length > 3) {
- for (int j = 3; j < split.length; j++) {
- name += ":" + split[j];
- }
- }
-
- // 去掉最后的空格
- name = name.substring(0, name.length() - 1);
-
- int lastFeatureId = featureIndex.get(split[1]);
-
- if ("/".equals(name)) {
- name = "//";
- }
-
- if (name.contains("//")) {
- name = name.replaceAll("//", "/XIEGANG/");
- }
- String featureName = toFeatureName(name.trim().split("/"), lastFeatureId);
-
- featureNames.add(Pair.with(split[1], featureName));
-
- }
- }
-
- return featureNames;
-
- }
-
- private String toFeatureName(String[] split, int lastFeatureId) throws Exception {
-
- StringBuilder result = new StringBuilder();
-
- for (String str : split) {
- if ("".equals(str)) {
- continue;
- } else if (str.length() == 1) {
- result.append(str.charAt(0));
- } else if (str.equals("XIEGANG")) {
- result.append('/');
- } else if (str.startsWith("num")) {
- result.append((char) (Config.NUM_BEGIN + ObjConver.getIntValue(str.replace("num", ""))));
- } else if (str.startsWith("en")) {
- result.append((char) (Config.EN_BEGIN + ObjConver.getIntValue(str.replace("en", ""))));
- } else if (str.startsWith("_x-")) {
- result.append(Config.BEGIN);
- } else if (str.startsWith("_x+")) {
- result.append(Config.END);
- } else {
- throw new Exception("can find feature named " + str + " in " + Arrays.toString(split));
- }
- }
-
- result.append((char) (lastFeatureId + Config.FEATURE_BEGIN));
-
- return result.toString();
- }
-
- /**
- * 加载特征标签转换
- *
- * @param br
- * @return
- * @throws Exception
- */
- private int[] loadTagCoven(BufferedReader br) throws Exception {
-
- int[] conver = new int[Config.TAG_NUM + Config.TAG_NUM * Config.TAG_NUM];
-
- String temp = br.readLine();// #qrk#4
-
- // TODO: 这个是个写死的过程,如果标签发生改变需要重新来写这里
- for (int i = 0; i < Config.TAG_NUM; i++) {
- char c = br.readLine().split(":")[1].charAt(0);
- switch (c) {
- case 'S':
- conver[i] = Config.S;
- break;
- case 'B':
- conver[i] = Config.B;
- break;
- case 'M':
- conver[i] = Config.M;
- break;
- case 'E':
- conver[i] = Config.E;
- break;
- default:
- throw new Exception("err tag named " + c + " in model " + temp);
- }
- }
-
- for (int i = Config.TAG_NUM; i < conver.length; i++) {
- conver[i] = conver[(i - 4) / Config.TAG_NUM] * Config.TAG_NUM + conver[i % Config.TAG_NUM] + Config.TAG_NUM;
- }
-
- return conver;
- }
-
- /**
- * 加载特征模板
- *
- * @param br
- * @return
- * @throws IOException
- */
- private Map loadConfig(BufferedReader br) throws IOException {
-
- Map featureIndex = new HashMap<>();
-
- String temp = br.readLine();// #rdr#8/0/0
-
- int featureNum = ObjConver.getIntValue(StringUtil.matcherFirst("\\d+", temp)); // 找到特征个数
-
- List list = new ArrayList<>();
-
- for (int i = 0; i < featureNum; i++) {
- temp = br.readLine();
-
- List matcherAll = StringUtil.matcherAll("\\[.*?\\]", temp);
-
- if (matcherAll.isEmpty()) {
- continue;
- }
-
- int[] is = new int[matcherAll.size()];
- for (int j = 0; j < is.length; j++) {
- is[j] = ObjConver.getIntValue(StringUtil.matcherFirst("[-\\d]+", matcherAll.get(j)));
- }
-
- featureIndex.put(temp.split(":")[1], list.size());
-
- list.add(is);
- }
-
- int[][] template = new int[list.size()][0]; // 构建特征模板
-
- for (int i = 0; i < template.length; i++) {
- template[i] = list.get(i);
- }
-
- config = new Config(template);
-
- return featureIndex;
- }
-
- @Override
- public boolean checkModel(String modelPath) {
-
- try (InputStream is = IOUtil.getInputStream(modelPath)) {
- byte[] bytes = new byte[100];
-
- is.read(bytes);
-
- String string = new String(bytes);
- if (string.startsWith("#mdl#")) { // 加载crf++ 的txt类型的modle
- return true;
- }
- } catch (IOException e) {
- logger.warn("IO异常", e);
- }
- return false;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/pojo/Element.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/pojo/Element.java
deleted file mode 100644
index 114f9f64d..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/crf/pojo/Element.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.crf.pojo;
-
-import org.ansj.app.crf.Config;
-import org.ansj.app.crf.Model;
-
-public class Element {
-
- public char name;
- private int tag = -1;
- public int len = 1;
- public String nature;
-
- public float[] tagScore;
-
- public int[] from;
-
- public Element(char name) {
- this.name = name;
- }
-
- public Element(Character name, int tag) {
- this.name = name;
- this.tag = tag;
- }
-
- public int getTag() {
- return tag;
- }
-
- public Element updateTag(int tag) {
- this.tag = tag;
- return this;
- }
-
- public Element updateNature(String nature) {
- this.nature = nature;
- return this;
- }
-
- @Override
- public String toString() {
- return name + "/" + len + "/" + tag;
- }
-
- public char getName() {
- return name;
- }
-
- /**
- * 获得可见的名称
- *
- * @return
- */
- public String nameStr() {
- if (name >= 130 && name < 140) {
- return ("num" + (name - 130));
- } else if (name >= 140 && name < 150) {
- return ("en" + (name - 140));
- } else {
- return String.valueOf(name);
- }
- }
-
- public void maxFrom(Model model, Element element) {
- if (from == null) {
- from = new int[Config.TAG_NUM];
- }
- float[] pTagScore = element.tagScore;
- for (int i = 0; i < Config.TAG_NUM; i++) {
- float maxValue = 0;
- for (int j = 0; j < Config.TAG_NUM; j++) {
-
- float value = (pTagScore[j] + tagScore[i]) + model.tagRate(j, i);
-
- if (tagScore.length > Config.TAG_NUM) {
- value += tagScore[Config.TAG_NUM + j * Config.TAG_NUM + i];
- }
-
- if (value > maxValue) {
- maxValue = value;
- from[i] = j;
- }
-
- }
-
- tagScore[i] = maxValue;
- }
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/KeyWordComputer.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/KeyWordComputer.java
deleted file mode 100644
index 7b1bd30b9..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/KeyWordComputer.java
+++ /dev/null
@@ -1,163 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.keyword;
-
-import org.ansj.domain.Term;
-import org.ansj.splitWord.Analysis;
-import org.ansj.splitWord.analysis.NlpAnalysis;
-import org.nlpcn.commons.lang.util.StringUtil;
-
-import java.util.*;
-
-public class KeyWordComputer {
-
- private static final Map POS_SCORE = new HashMap<>();
- private T analysisType;
-
-
- static {
- POS_SCORE.put("null", 0.0);
- POS_SCORE.put("w", 0.0);
- POS_SCORE.put("en", 0.0);
- POS_SCORE.put("m", 0.0);
- POS_SCORE.put("num", 0.0);
- POS_SCORE.put("nr", 3.0);
- POS_SCORE.put("nrf", 3.0);
- POS_SCORE.put("nw", 3.0);
- POS_SCORE.put("nt", 3.0);
- POS_SCORE.put("l", 0.2);
- POS_SCORE.put("a", 0.2);
- POS_SCORE.put("nz", 3.0);
- POS_SCORE.put("v", 0.2);
- POS_SCORE.put("kw", 6.0); //关键词词性
- }
-
- private int nKeyword = 5;
-
-
- public KeyWordComputer() {}
-
- public void setAnalysisType(T analysisType) {
- this.analysisType = analysisType;
- }
-
-
- /**
- * 返回关键词个数
- *
- * @param nKeyword
- */
- public KeyWordComputer(int nKeyword) {
- this.nKeyword = nKeyword;
- this.analysisType = (T) new NlpAnalysis();//默认使用NLP的分词方式
-
- }
-
- public KeyWordComputer(int nKeyword, T analysisType) {
- this.nKeyword = nKeyword;
- this.analysisType = analysisType;
- }
-
- /**
- * @param content 正文
- * @return
- */
- private List computeArticleTfidf(String content, int titleLength) {
- Map tm = new HashMap<>();
-
- List parse = analysisType.parseStr(content).getTerms();
- //FIXME: 这个依赖于用户自定义词典的词性,所以得需要另一个方法..
- // parse = FilterModifWord.updateNature(parse) ;
-
- for (Term term : parse) {
- double weight = getWeight(term, content.length(), titleLength);
- if (weight == 0)
- continue;
-
- Keyword keyword = tm.get(term.getName());
-
-
- if (keyword == null) {
- keyword = new Keyword(term.getName(), term.natrue().allFrequency, weight);
- tm.put(term.getName(), keyword);
- } else {
- keyword.updateWeight(1);
- }
- }
-
- TreeSet treeSet = new TreeSet<>(tm.values());
-
- ArrayList arrayList = new ArrayList<>(treeSet);
- if (treeSet.size() <= nKeyword) {
- return arrayList;
- } else {
- return arrayList.subList(0, nKeyword);
- }
-
- }
-
- /**
- * @param title 标题
- * @param content 正文
- * @return
- */
- public List computeArticleTfidf(String title, String content) {
- if (StringUtil.isBlank(title)) {
- title = "";
- }
- if (StringUtil.isBlank(content)) {
- content = "";
- }
- return computeArticleTfidf(title + "\t" + content, title.length());
- }
-
- /**
- * 只有正文
- *
- * @param content
- * @return
- */
- public List computeArticleTfidf(String content) {
- return computeArticleTfidf(content, 0);
- }
-
- private double getWeight(Term term, int length, int titleLength) {
- if (term.getName().trim().length() < 2) {
- return 0;
- }
-
- String pos = term.natrue().natureStr;
-
- Double posScore = POS_SCORE.get(pos);
-
- if (posScore == null) {
- posScore = 1.0;
- } else if (posScore == 0) {
- return 0;
- }
-
- if (titleLength > term.getOffe()) {
- return 5 * posScore;
- }
- return (length - term.getOffe()) * posScore / length;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/Keyword.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/Keyword.java
deleted file mode 100644
index 07d352b46..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/Keyword.java
+++ /dev/null
@@ -1,94 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.keyword;
-
-public class Keyword implements Comparable {
- private String name;
- private double score;
- private double idf;
- private int freq;
-
- public Keyword(String name, int docFreq, double weight) {
- this.name = name;
- this.idf = Math.log(1 + 10000.0 / (docFreq + 1));
- this.score = idf * weight;
- freq++;
- }
-
- public Keyword(String name, double score) {
- this.name = name;
- this.score = score;
- this.idf = score;
- freq++;
- }
-
- public void updateWeight(int weight) {
- this.score += weight * idf;
- freq++;
- }
-
- public int getFreq() {
- return freq;
- }
-
- @Override
- public int compareTo(Keyword o) {
- if (this.score < o.score) {
- return 1;
- } else {
- return -1;
- }
-
- }
-
- @Override
- public boolean equals(Object obj) {
-
- if (obj instanceof Keyword) {
- Keyword k = (Keyword) obj;
- return k.name.equals(name);
- } else {
- return false;
- }
- }
-
- @Override
- public String toString() {
- return name + "/" + score;// "="+score+":"+freq+":"+idf;
- }
-
- public String getName() {
- return name;
- }
-
- public void setName(String name) {
- this.name = name;
- }
-
- public double getScore() {
- return score;
- }
-
- public void setScore(double score) {
- this.score = score;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/package-info.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/package-info.java
deleted file mode 100644
index a2d1104ca..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/keyword/package-info.java
+++ /dev/null
@@ -1,25 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-/**
- * @author 崇伟峰
- *
- */
-package org.ansj.app.keyword;
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/SummaryComputer.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/SummaryComputer.java
deleted file mode 100644
index 10fbd4ef9..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/SummaryComputer.java
+++ /dev/null
@@ -1,332 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.summary;
-
-import org.ansj.app.keyword.KeyWordComputer;
-import org.ansj.app.keyword.Keyword;
-import org.ansj.app.summary.pojo.Summary;
-import org.ansj.domain.Term;
-import org.ansj.splitWord.analysis.NlpAnalysis;
-import org.nlpcn.commons.lang.tire.SmartGetWord;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.MapCount;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Set;
-
-/**
- * 自动摘要,同时返回关键词
- *
- * @author ansj
- *
- */
-public class SummaryComputer {
-
- private static final Set FILTER_SET = new HashSet<>();
-
- static {
- FILTER_SET.add("w");
- FILTER_SET.add("null");
- }
-
- /**
- * summaryLength
- */
- private int len = 300;
-
- private boolean isSplitSummary = true;
-
- String title, content;
-
- public SummaryComputer(String title, String content) {
- this.title = title;
- this.content = content;
- }
-
- public SummaryComputer(int len, String title, String content) {
- this.len = len;
- this.title = title;
- this.content = content;
- }
-
- public SummaryComputer(int len, boolean isSplitSummary, String title, String content) {
- this.len = len;
- this.title = title;
- this.content = content;
- this.isSplitSummary = isSplitSummary;
- }
-
- /**
- * 计算摘要,利用关键词抽取计算
- *
- * @return
- */
- public Summary toSummary() {
- return toSummary(new ArrayList());
- }
-
- /**
- * 根据用户查询串计算摘要
- *
- * @return
- */
- public Summary toSummary(String query) {
-
- List parse = NlpAnalysis.parse(query).getTerms();
-
- List keywords = new ArrayList<>();
- for (Term term : parse) {
- if (FILTER_SET.contains(term.natrue().natureStr)) {
- continue;
- }
- keywords.add(new Keyword(term.getName(), term.termNatures().allFreq, 1));
- }
-
- return toSummary(keywords);
- }
-
- /**
- * 计算摘要,传入用户自己算好的关键词
- *
- * @return
- */
- public Summary toSummary(List keywords) {
-
- if (keywords == null) {
- keywords = new ArrayList<>();
- }
-
- if (keywords.isEmpty()) {
-
- KeyWordComputer kc = new KeyWordComputer(10);
- keywords = kc.computeArticleTfidf(title, content);
- }
- return explan(keywords, content);
- }
-
- /**
- * 计算摘要
- *
- * @param keyword
- * @param content
- * @return
- */
- private Summary explan(List keywords, String content) {
-
- SmartForest sf = new SmartForest<>();
-
- for (Keyword keyword : keywords) {
- sf.add(keyword.getName(), keyword.getScore());
- }
-
- // 先断句
- List sentences = toSentenceList(content.toCharArray());
-
- for (Sentence sentence : sentences) {
- computeScore(sentence, sf);
- }
-
- double maxScore = 0;
- int maxIndex = 0;
-
- MapCount mc = new MapCount<>();
-
- for (int i = 0; i < sentences.size(); i++) {
- double tempScore = sentences.get(i).score;
- int tempLength = sentences.get(i).value.length();
- mc.addAll(sentences.get(i).mc.get());
-
- if (tempLength >= len) {
- tempScore = tempScore * mc.get().size();
- if (maxScore < tempScore) {
- maxScore = tempScore;
- maxIndex = i;
- continue;
- }
- mc.get().clear();
- }
- for (int j = i + 1; j < sentences.size(); j++) {
- tempScore += sentences.get(j).score;
- tempLength += sentences.get(j).value.length();
- mc.addAll(sentences.get(j).mc.get());
-
- if (tempLength >= len) {
- tempScore = tempScore * mc.get().size();
- if (maxScore < tempScore) {
- maxScore = tempScore;
- maxIndex = i;
- }
- mc.get().clear();
- break;
- }
- }
-
- if (tempLength < len) {
- tempScore = tempScore * mc.get().size();
- if (maxScore < tempScore) {
- maxScore = tempScore;
- maxIndex = i;
- break;
- }
- mc.get().clear();
- }
- }
-
- StringBuilder sb = new StringBuilder();
- for (int i = maxIndex; i < sentences.size(); i++) {
- sb.append(sentences.get(i).value);
- if (sb.length() > len) {
- break;
- }
- }
-
- String summaryStr = sb.toString();
-
- /**
- * 是否强制文本长度。对于abc这种字符算半个长度
- */
-
- if (isSplitSummary && sb.length() > len) {
- double value = len;
-
- StringBuilder newSummary = new StringBuilder();
- char c = 0;
- for (int i = 0; i < sb.length(); i++) {
- c = sb.charAt(i);
- if (c < 256) {
- value -= 0.5;
- } else {
- value -= 1;
- }
-
- if (value < 0) {
- break;
- }
-
- newSummary.append(c);
- }
-
- summaryStr = newSummary.toString();
- }
-
- return new Summary(keywords, summaryStr);
- }
-
- /**
- * 计算一个句子的分数
- *
- * @param sentence
- * @param sf
- */
- private void computeScore(Sentence sentence, SmartForest forest) {
- SmartGetWord sgw = new SmartGetWord<>(forest, sentence.value);
- String name = null;
- while ((name = sgw.getFrontWords()) != null) {
- sentence.updateScore(name, sgw.getParam());
- }
- if (sentence.score == 0) {
- sentence.score = sentence.value.length() * -0.005;
- } else {
- sentence.score /= Math.log(sentence.value.length() + 3);
- }
- }
-
- public List toSentenceList(char[] chars) {
-
- StringBuilder sb = new StringBuilder();
-
- List sentences = new ArrayList<>();
-
- for (int i = 0; i < chars.length; i++) {
- if (sb.length() == 0 && (Character.isWhitespace(chars[i]) || chars[i] == ' ')) {
- continue;
- }
-
- sb.append(chars[i]);
- switch (chars[i]) {
- case '.':
- if (i < chars.length - 1 && chars[i + 1] > 128) {
- insertIntoList(sb, sentences);
- sb = new StringBuilder();
- }
- break;
- //case ' ':
- case ' ':
- case ' ':
- case ' ':
- case ',':
- case '。':
- case ';':
- case ';':
- case '!':
- case '!':
- case ',':
- case '?':
- case '?':
- case '\n':
- case '\r':
- insertIntoList(sb, sentences);
- sb = new StringBuilder();
- }
- }
-
- if (sb.length() > 0) {
- insertIntoList(sb, sentences);
- }
-
- return sentences;
- }
-
- private void insertIntoList(StringBuilder sb, List sentences) {
- String content = sb.toString().trim();
- if (content.length() > 0) {
- sentences.add(new Sentence(content));
- }
- }
-
- /*
- * 句子对象
- */
- public class Sentence {
- String value;
- private double score;
-
- private MapCount mc = new MapCount<>();
-
- public Sentence(String value) {
- this.value = value.trim();
- }
-
- public void updateScore(String name, double score) {
- mc.add(name);
- Double size = mc.get().get(name);
- this.score += score / size;
- }
-
- @Override
- public String toString() {
- return value;
- }
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/TagContent.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/TagContent.java
deleted file mode 100644
index d15f63970..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/TagContent.java
+++ /dev/null
@@ -1,75 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.summary;
-
-import org.ansj.app.keyword.Keyword;
-import org.ansj.app.summary.pojo.Summary;
-import org.nlpcn.commons.lang.tire.SmartGetWord;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-
-import java.util.List;
-
-/**
- * 关键字标红,
- *
- * @author ansj
- *
- */
-public class TagContent {
-
- private String beginTag, endTag;
-
- public TagContent(String beginTag, String endTag) {
- this.beginTag = beginTag;
- this.endTag = endTag;
- }
-
- public String tagContent(Summary summary) {
- return tagContent(summary.getKeyWords(), summary.getSummary());
- }
-
- public String tagContent(List keyWords, String content) {
- SmartForest sf = new SmartForest<>();
- for (Keyword keyWord : keyWords) {
- sf.add(keyWord.getName().toLowerCase(), keyWord.getScore());
- }
-
- SmartGetWord sgw = new SmartGetWord<>(sf, content.toLowerCase());
-
- int beginOffe = 0;
- String temp = null;
- StringBuilder sb = new StringBuilder();
- while ((temp = sgw.getFrontWords()) != null) {
- sb.append(content.substring(beginOffe, sgw.offe));
- sb.append(beginTag);
- sb.append(content.substring(sgw.offe, sgw.offe + temp.length()));
- sb.append(endTag);
- beginOffe = sgw.offe + temp.length();
- }
-
- if (beginOffe <= content.length() - 1) {
- sb.append(content.substring(beginOffe, content.length()));
- }
-
- return sb.toString();
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/pojo/Summary.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/pojo/Summary.java
deleted file mode 100644
index 6b5df34ef..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/app/summary/pojo/Summary.java
+++ /dev/null
@@ -1,58 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.app.summary.pojo;
-
-import org.ansj.app.keyword.Keyword;
-
-import java.util.List;
-
-/**
- * 摘要结构体封装
- *
- * @author ansj
- *
- */
-public class Summary {
-
- /**
- * 关键词
- */
- private List keyWords = null;
-
- /**
- * 摘要
- */
- private String summary;
-
- public Summary(List keyWords, String summary) {
- this.keyWords = keyWords;
- this.summary = summary;
- }
-
- public List getKeyWords() {
- return keyWords;
- }
-
- public String getSummary() {
- return summary;
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/DicReader.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/DicReader.java
deleted file mode 100644
index 8862c0619..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/DicReader.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.dic;
-
-import org.nlpcn.commons.lang.util.logging.Log;
-import org.nlpcn.commons.lang.util.logging.LogFactory;
-
-import java.io.BufferedReader;
-import java.io.InputStream;
-import java.io.InputStreamReader;
-import java.io.UnsupportedEncodingException;
-
-/**
- * 加载词典用的类
- *
- * @author ansj
- */
-public class DicReader {
-
- private static final Log logger = LogFactory.getLog();
-
- public static BufferedReader getReader(String name) {
- // maven工程修改词典加载方式
- InputStream in = DicReader.class.getResourceAsStream("/" + name);
- try {
- return new BufferedReader(new InputStreamReader(in, "UTF-8"));
- } catch (UnsupportedEncodingException e) {
- logger.warn("不支持的编码", e);
- }
- return null;
- }
-
- public static InputStream getInputStream(String name) {
- // maven工程修改词典加载方式
- InputStream in = DicReader.class.getResourceAsStream("/" + name);
- return in;
- }
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/LearnTool.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/LearnTool.java
deleted file mode 100644
index 16295a337..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/LearnTool.java
+++ /dev/null
@@ -1,207 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.dic;
-
-import org.ansj.app.crf.SplitWord;
-import org.ansj.domain.Nature;
-import org.ansj.domain.NewWord;
-import org.ansj.domain.TermNatures;
-import org.ansj.recognition.arrimpl.AsianPersonRecognition;
-import org.ansj.recognition.arrimpl.ForeignPersonRecognition;
-import org.ansj.recognition.impl.NatureRecognition;
-import org.ansj.util.Graph;
-import org.nlpcn.commons.lang.tire.domain.Forest;
-import org.nlpcn.commons.lang.tire.domain.SmartForest;
-import org.nlpcn.commons.lang.util.CollectionUtil;
-
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map.Entry;
-
-/**
- * 新词发现,这是个线程安全的.所以可以多个对象公用一个
- *
- * @author ansj
- *
- */
-public class LearnTool {
-
- private SplitWord splitWord = null;
-
- /**
- * 是否开启学习机
- */
- public boolean isAsianName = true;
-
- public boolean isForeignName = true;
-
- /**
- * 告诉大家你学习了多少个词了
- */
- public int count;
-
- /**
- * 新词发现的结果集.可以序列化到硬盘.然后可以当做训练集来做.
- */
- private final SmartForest sf = new SmartForest<>();
-
- /**
- * 学习新词排除用户自定义词典那中的词语
- */
- private Forest[] forests;
-
- /**
- * 公司名称学习.
- *
- * @param graph
- */
- public void learn(Graph graph, SplitWord splitWord, Forest... forests) {
-
- this.splitWord = splitWord;
-
- this.forests = forests;
-
- // 亚洲人名识别
- if (isAsianName) {
- findAsianPerson(graph);
- }
-
- // 外国人名识别
- if (isForeignName) {
- findForeignPerson(graph);
- }
-
- }
-
- private void findAsianPerson(Graph graph) {
- List newWords = new AsianPersonRecognition().getNewWords(graph.terms);
- addListToTerm(newWords);
- }
-
- private void findForeignPerson(Graph graph) {
- List newWords = new ForeignPersonRecognition().getNewWords(graph.terms);
- addListToTerm(newWords);
- }
-
- // 批量将新词加入到词典中
- private void addListToTerm(List newWords) {
- if (newWords.isEmpty())
- return;
- for (NewWord newWord : newWords) {
-
- TermNatures termNatures = new NatureRecognition(forests).getTermNatures(newWord.getName());
-
- if (termNatures == TermNatures.NULL) {
- addTerm(newWord);
- }
- }
- }
-
- /**
- * 增加一个新词到树中
- *
- * @param newWord
- */
- public void addTerm(NewWord newWord) {
- NewWord temp = null;
- SmartForest smartForest = null;
- if ((smartForest = sf.getBranch(newWord.getName())) != null && smartForest.getParam() != null) {
- temp = smartForest.getParam();
- temp.update(newWord.getNature(), newWord.getAllFreq());
- } else {
- count++;
- if (splitWord == null) {
- newWord.setScore(-1);
- } else {
- newWord.setScore(-splitWord.cohesion(newWord.getName()));
- }
-
- synchronized (sf) {
- sf.add(newWord.getName(), newWord);
- }
- }
- }
-
- public SmartForest getForest() {
- return this.sf;
- }
-
- /**
- * 返回学习到的新词.
- *
- * @param num 返回数目.0为全部返回
- * @return
- */
- public List> getTopTree(int num) {
- return getTopTree(num, null);
- }
-
- public List> getTopTree(int num, Nature nature) {
- if (sf.branches == null) {
- return null;
- }
- HashMap hm = new HashMap<>();
- for (int i = 0; i < sf.branches.length; i++) {
- valueResult(sf.branches[i], hm, nature);
- }
- List> sortMapByValue = CollectionUtil.sortMapByValue(hm, -1);
- if (num == 0) {
- return sortMapByValue;
- } else {
- num = Math.min(num, sortMapByValue.size());
- return sortMapByValue.subList(0, num);
- }
- }
-
- private void valueResult(SmartForest smartForest, HashMap hm, Nature nature) {
-
- if (smartForest == null || smartForest.branches == null) {
- return;
- }
- for (int i = 0; i < smartForest.branches.length; i++) {
- NewWord param = smartForest.branches[i].getParam();
- if (smartForest.branches[i].getStatus() == 3) {
- if (param.isActive() && (nature == null || param.getNature().equals(nature))) {
- hm.put(param.getName(), param.getScore());
- }
- } else if (smartForest.branches[i].getStatus() == 2) {
- if (param.isActive() && (nature == null || param.getNature().equals(nature))) {
- hm.put(param.getName(), param.getScore());
- }
- valueResult(smartForest.branches[i], hm, nature);
- } else {
- valueResult(smartForest.branches[i], hm, nature);
- }
- }
- }
-
- /**
- * 尝试激活,新词
- *
- * @param name
- */
- public void active(String name) {
- SmartForest branch = sf.getBranch(name);
- if (branch != null && branch.getParam() != null) {
- branch.getParam().setActive(true);
- }
- }
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/PathToStream.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/PathToStream.java
deleted file mode 100644
index 32ced758b..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/PathToStream.java
+++ /dev/null
@@ -1,66 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.dic;
-
-import org.ansj.dic.impl.File2Stream;
-import org.ansj.dic.impl.Jar2Stream;
-import org.ansj.dic.impl.Jdbc2Stream;
-import org.ansj.dic.impl.Url2Stream;
-import org.ansj.exception.LibraryException;
-import org.deeplearning4j.common.config.DL4JClassLoading;
-
-import java.io.InputStream;
-
-public abstract class PathToStream {
-
- public static InputStream stream(String path) {
- try {
- if (path.startsWith("file://")) {
- return new File2Stream().toStream(path);
- } else if (path.startsWith("jdbc://")) {
- return new Jdbc2Stream().toStream(path);
- } else if (path.startsWith("jar://")) {
- return new Jar2Stream().toStream(path);
- } else if (path.startsWith("class://")) {
- // Probably unused
- return loadClass(path);
- } else if (path.startsWith("http://") || path.startsWith("https://")) {
- return new Url2Stream().toStream(path);
- } else {
- return new File2Stream().toStream(path);
- }
- } catch (Exception e) {
- throw new LibraryException(e);
- }
- }
-
- public abstract InputStream toStream(String path);
-
- static InputStream loadClass(String path) {
- String className = path
- .substring("class://".length())
- .split("\\|")[0];
-
- return DL4JClassLoading
- .createNewInstance(className, PathToStream.class)
- .toStream(path);
- }
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/File2Stream.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/File2Stream.java
deleted file mode 100644
index cda851134..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/File2Stream.java
+++ /dev/null
@@ -1,103 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.dic.impl;
-
-import org.ansj.dic.PathToStream;
-import org.ansj.exception.LibraryException;
-import org.nlpcn.commons.lang.util.logging.Log;
-import org.nlpcn.commons.lang.util.logging.LogFactory;
-
-import java.io.*;
-import java.util.Vector;
-
-public class File2Stream extends PathToStream {
-
- private static final Log LOG = LogFactory.getLog(File2Stream.class);
-
- @Override
- public InputStream toStream(String path) {
- LOG.info("path to stream " + path);
-
- if (path.startsWith("file://")) {
- path = path.substring(7);
- }
-
- File file = new File(path);
-
- if (file.exists() && file.canRead()) {
-
- try {
- if (file.isDirectory()) {
- return multiple(path);
- } else {
- return new FileInputStream(file);
- }
- } catch (Exception e) {
- throw new LibraryException(e);
- }
- }
- throw new LibraryException(
- " path :" + path + " file:" + file.getAbsolutePath() + " not found or can not to read");
-
- }
-
- private InputStream multiple(String path) throws FileNotFoundException {
- File[] libs = new File[0];
-
- File file = new File(path);
-
- if (file.exists() && file.canRead()) {
- if (file.isFile()) {
- libs = new File[1];
- libs[0] = file;
- } else if (file.isDirectory()) {
-
- File[] files = file.listFiles(new FileFilter() {
- @Override
- public boolean accept(File file) {
- return file.canRead() && !file.isHidden() && !file.isDirectory();
- }
- });
-
- if (files != null && files.length > 0) {
- libs = files;
- }
- }
- }
-
- if (libs.length == 0) {
- throw new LibraryException("not find any file in path : " + path);
- }
-
- if (libs.length == 1) {
- return new FileInputStream(libs[0]);
- }
-
- Vector vector = new Vector<>(libs.length);
-
- for (int i = 0; i < libs.length; i++) {
- vector.add(new FileInputStream(libs[i]));
- }
-
- return new SequenceInputStream(vector.elements());
- }
-
-}
diff --git a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/Jar2Stream.java b/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/Jar2Stream.java
deleted file mode 100644
index b139cbd90..000000000
--- a/deeplearning4j/deeplearning4j-nlp-parent/deeplearning4j-nlp-chinese/src/main/java/org/ansj/dic/impl/Jar2Stream.java
+++ /dev/null
@@ -1,50 +0,0 @@
-/*
- * ******************************************************************************
- * *
- * *
- * * This program and the accompanying materials are made available under the
- * * terms of the Apache License, Version 2.0 which is available at
- * * https://www.apache.org/licenses/LICENSE-2.0.
- * *
- * * See the NOTICE file distributed with this work for additional
- * * information regarding copyright ownership.
- * * Unless required by applicable law or agreed to in writing, software
- * * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * * License for the specific language governing permissions and limitations
- * * under the License.
- * *
- * * SPDX-License-Identifier: Apache-2.0
- * *****************************************************************************
- */
-
-package org.ansj.dic.impl;
-
-import org.ansj.dic.DicReader;
-import org.ansj.dic.PathToStream;
-import org.ansj.exception.LibraryException;
-import org.deeplearning4j.common.config.DL4JClassLoading;
-
-import java.io.InputStream;
-
-public class Jar2Stream extends PathToStream {
-
- @Override
- public InputStream toStream(String path) {
- if (path.contains("|")) {
- String[] tokens = path.split("\\|");
- String className = tokens[0].substring(6);
- String resourceName = tokens[1].trim();
-
- Class