Skip to content

Commit 41bb848

Browse files
committed
add nb_example data
1 parent 984405f commit 41bb848

File tree

4 files changed

+10
-14
lines changed

4 files changed

+10
-14
lines changed

TensorFlow.NET.sln

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keras.UnitTest", "test\Kera
1717
EndProject
1818
Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TensorFlowNET.Examples.FSharp", "test\TensorFlowNET.Examples.FSharp\TensorFlowNET.Examples.FSharp.fsproj", "{62BC3801-F0D3-44A9-A0AC-712F40C8F961}"
1919
EndProject
20-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NumSharp.Core", "..\NumSharp\src\NumSharp.Core\NumSharp.Core.csproj", "{E038A3C1-9055-4BF4-BE5B-0E7D661A7EB3}"
21-
EndProject
2220
Global
2321
GlobalSection(SolutionConfigurationPlatforms) = preSolution
2422
Debug|Any CPU = Debug|Any CPU
@@ -53,10 +51,6 @@ Global
5351
{62BC3801-F0D3-44A9-A0AC-712F40C8F961}.Debug|Any CPU.Build.0 = Debug|Any CPU
5452
{62BC3801-F0D3-44A9-A0AC-712F40C8F961}.Release|Any CPU.ActiveCfg = Release|Any CPU
5553
{62BC3801-F0D3-44A9-A0AC-712F40C8F961}.Release|Any CPU.Build.0 = Release|Any CPU
56-
{E038A3C1-9055-4BF4-BE5B-0E7D661A7EB3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
57-
{E038A3C1-9055-4BF4-BE5B-0E7D661A7EB3}.Debug|Any CPU.Build.0 = Debug|Any CPU
58-
{E038A3C1-9055-4BF4-BE5B-0E7D661A7EB3}.Release|Any CPU.ActiveCfg = Release|Any CPU
59-
{E038A3C1-9055-4BF4-BE5B-0E7D661A7EB3}.Release|Any CPU.Build.0 = Release|Any CPU
6054
EndGlobalSection
6155
GlobalSection(SolutionProperties) = preSolution
6256
HideSolutionNode = FALSE

data/nb_example.npy

14.2 KB
Binary file not shown.

src/TensorFlowNET.Core/TensorFlowNET.Core.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,6 @@ Docs: https://tensorflownet.readthedocs.io</Description>
6262
<Folder Include="Keras\Initializers\" />
6363
</ItemGroup>
6464

65-
<ItemGroup>
66-
<ProjectReference Include="..\..\..\NumSharp\src\NumSharp.Core\NumSharp.Core.csproj" />
67-
</ItemGroup>
68-
6965
<ItemGroup>
7066
<Reference Include="NumSharp.Core">
7167
<HintPath>..\..\..\..\NumSharp\src\NumSharp.Core\bin\Debug\netstandard2.0\NumSharp.Core.dll</HintPath>

test/TensorFlowNET.Examples/BasicModels/NaiveBayesClassifier.cs

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
using NumSharp;
66
using System.Linq;
77
using static Tensorflow.Python;
8+
using System.IO;
9+
using TensorFlowNET.Examples.Utility;
810

911
namespace TensorFlowNET.Examples
1012
{
@@ -34,10 +36,10 @@ public bool Run()
3436
var (xx, yy) = np.meshgrid(np.linspace(x_min, x_max, 30), np.linspace(y_min, y_max, 30));
3537
with(tf.Session(), sess =>
3638
{
37-
var samples = np.vstack<float>(xx.ravel(), yy.ravel());
38-
samples = np.transpose(samples);
39-
var array = np.Load<double[,]>("H:\\PythonApplication1\\PythonApplication1\\data.npy");
40-
samples = np.array(array).astype(np.float32);
39+
//var samples = np.vstack<float>(xx.ravel(), yy.ravel());
40+
//samples = np.transpose(samples);
41+
var array = np.Load<double[,]>(Path.Join("nb", "nb_example.npy"));
42+
var samples = np.array(array).astype(np.float32);
4143
var Z = sess.run(predict(samples));
4244
});
4345

@@ -170,6 +172,10 @@ public void PrepareData()
170172
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
171173
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
172174
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2);
175+
176+
177+
string url = "https://raw.githubusercontent.com/SciSharp/TensorFlow.NET/master/data/nb_example.npy";
178+
Web.Download(url, "nb", "nb_example.npy");
173179
#endregion
174180
}
175181

0 commit comments

Comments
 (0)