|
5 | 5 | using NumSharp; |
6 | 6 | using System.Linq; |
7 | 7 | using static Tensorflow.Python; |
| 8 | +using System.IO; |
| 9 | +using TensorFlowNET.Examples.Utility; |
8 | 10 |
|
9 | 11 | namespace TensorFlowNET.Examples |
10 | 12 | { |
@@ -34,10 +36,10 @@ public bool Run() |
34 | 36 | var (xx, yy) = np.meshgrid(np.linspace(x_min, x_max, 30), np.linspace(y_min, y_max, 30)); |
35 | 37 | with(tf.Session(), sess => |
36 | 38 | { |
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); |
41 | 43 | var Z = sess.run(predict(samples)); |
42 | 44 | }); |
43 | 45 |
|
@@ -170,6 +172,10 @@ public void PrepareData() |
170 | 172 | 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
171 | 173 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, |
172 | 174 | 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"); |
173 | 179 | #endregion |
174 | 180 | } |
175 | 181 |
|
|
0 commit comments