| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1,5 +1,6 @@ | |||
| 1 | 1 | using System; | |
| 2 | 2 | using System.Collections.Generic; | |
| 3 | + using System.Diagnostics; | ||
| 3 | 4 | using System.Text; | |
| 4 | 5 | using NumSharp; | |
| 5 | 6 | using Tensorflow; | |
@@ -21,7 +22,12 @@ public MnistDataSet(NDArray images, NDArray labels, Type dataType, bool reshape) | |||
| 21 | 22 | ||
| 22 | 23 | images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]); | |
| 23 | 24 | images = images.astype(dataType); | |
| 25 | + // for debug np.multiply performance | ||
| 26 | + var sw = new Stopwatch(); | ||
| 27 | + sw.Start(); | ||
| 24 | 28 | images = np.multiply(images, 1.0f / 255.0f); | |
| 29 | + sw.Stop(); | ||
| 30 | + Console.WriteLine($"{sw.ElapsedMilliseconds}ms"); | ||
| 25 | 31 | Data = images; | |
| 26 | 32 | ||
| 27 | 33 | labels = labels.astype(dataType); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -55,7 +55,7 @@ public void Check(bool throwException = false) | |||
| 55 | 55 | Console.WriteLine(Message); | |
| 56 | 56 | if (throwException) | |
| 57 | 57 | { | |
| 58 | - // throw new Exception(Message); | ||
| 58 | + throw new Exception(Message); | ||
| 59 | 59 | } | |
| 60 | 60 | } | |
| 61 | 61 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments