From cfec53ea941c73bf8c80110fe826a40bbc3b581b Mon Sep 17 00:00:00 2001 From: Oceania2018 Date: Wed, 7 Aug 2019 20:10:08 -0500 Subject: [PATCH] The Logistic Regression accuracy is correct. But still has performance issue. --- src/TensorFlowHub/MnistDataSet.cs | 2 +- src/TensorFlowHub/Utils.cs | 4 ++-- src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/TensorFlowHub/MnistDataSet.cs b/src/TensorFlowHub/MnistDataSet.cs index 8ad0e687..07b2c181 100644 --- a/src/TensorFlowHub/MnistDataSet.cs +++ b/src/TensorFlowHub/MnistDataSet.cs @@ -20,7 +20,7 @@ namespace Tensorflow.Hub NumOfExamples = images.shape[0]; images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]); - images.astype(dataType); + images = images.astype(dataType); images = np.multiply(images, 1.0f / 255.0f); Data = images; diff --git a/src/TensorFlowHub/Utils.cs b/src/TensorFlowHub/Utils.cs index 5a08849b..5b06aaad 100644 --- a/src/TensorFlowHub/Utils.cs +++ b/src/TensorFlowHub/Utils.cs @@ -116,11 +116,11 @@ namespace Tensorflow.Hub { var cols = 0; - await Task.Delay(1000); + await Task.Delay(100); while (!cts.IsCancellationRequested) { - await Task.Delay(1000); + await Task.Delay(100); Console.Write("."); cols++; diff --git a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs index c9b7b750..4988836d 100644 --- a/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs +++ b/src/TensorFlowNET.Core/Tensors/Tensor.Creation.cs @@ -514,7 +514,7 @@ namespace Tensorflow if (nd.dtype.Name != "String") { buffersize = (nd.size * nd.dtypesize); - dotHandle = Marshal.AllocHGlobal(buffersize); + // dotHandle = Marshal.AllocHGlobal(buffersize); } var dataType = ToTFDataType(nd.dtype);