|
@@ -108,10 +108,16 @@ public class TensorflowModel {
|
|
|
inputShape,
|
|
|
FloatBuffer.wrap(inputValues)
|
|
|
);
|
|
|
-
|
|
|
- // 序列数据
|
|
|
- if (this.withSequenceInputs){
|
|
|
- Map<String, Tensor<Integer>> sequenceTensorMap = this.wrapSequenceInputs(sequenceValues, numExamples);
|
|
|
+ float[][] f = new float[numExamples][NUM_LABEL];
|
|
|
+ for (int i = 0; i < numExamples; i++) {
|
|
|
+ for (int j = 0; j < NUM_LABEL; j++) {
|
|
|
+ f[i][j] = 0.1f;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ return f;
|
|
|
+// // 序列数据
|
|
|
+// if (this.withSequenceInputs){
|
|
|
+// Map<String, Tensor<Integer>> sequenceTensorMap = this.wrapSequenceInputs(sequenceValues, numExamples);
|
|
|
|
|
|
|
|
|
// return this.session.runner().feed(this.X, inputTensor)
|
|
@@ -120,20 +126,14 @@ public class TensorflowModel {
|
|
|
// .feed("keep_prob", Tensor.create(1.0f, Float.class)) // dropout保留率
|
|
|
// .fetch(this.SOFT_MAX).run().get(0)
|
|
|
// .copyTo(new float[numExamples][this.NUM_LABEL]);
|
|
|
- }else{
|
|
|
+// }else{
|
|
|
// return this.session.runner().feed(this.X, inputTensor)
|
|
|
// .feed("keep_prob", Tensor.create(1.0f, Float.class)) // dropout保留率
|
|
|
// .fetch(this.SOFT_MAX).run().get(0)
|
|
|
// .copyTo(new float[numExamples][this.NUM_LABEL]);
|
|
|
- }
|
|
|
+// }
|
|
|
+
|
|
|
|
|
|
- float[][] f = new float[numExamples][NUM_LABEL];
|
|
|
- for (int i = 0; i < numExamples; i++) {
|
|
|
- for (int j = 0; j < NUM_LABEL; j++) {
|
|
|
- f[i][j] = 0.1f;
|
|
|
- }
|
|
|
- }
|
|
|
- return f;
|
|
|
}
|
|
|
|
|
|
|