| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 316ad5f commit 5ff096c
6 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -54,7 +54,7 @@ Docs: https://tensorflownet.readthedocs.io</Description> | |||
| 54 | 54 | ||
| 55 | 55 | <ItemGroup> | |
| 56 | 56 | <PackageReference Include="Google.Protobuf" Version="3.8.0" /> | |
| 57 | - <PackageReference Include="Microsoft.ML.TensorFlow.Redist" Version="0.13.0" /> | ||
| 57 | + <PackageReference Include="Microsoft.ML.TensorFlow.Redist" Version="0.14.0" /> | ||
| 58 | 58 | <PackageReference Include="NumSharp" Version="0.10.3" /> | |
| 59 | 59 | </ItemGroup> | |
| 60 | 60 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -26,7 +26,7 @@ | |||
| 26 | 26 | </PropertyGroup> | |
| 27 | 27 | ||
| 28 | 28 | <ItemGroup> | |
| 29 | - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" /> | ||
| 29 | + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
| 30 | 30 | <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | |
| 31 | 31 | <PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | |
| 32 | 32 | </ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,63 @@ | |||
| 1 | + using System; | ||
| 2 | + using System.Collections.Generic; | ||
| 3 | + using System.Text; | ||
| 4 | + using Tensorflow; | ||
| 5 | + using TensorFlowNET.Examples.Utility; | ||
| 6 | + | ||
| 7 | + namespace TensorFlowNET.Examples.ImageProcess | ||
| 8 | + { | ||
| 9 | + /// <summary> | ||
| 10 | + /// Neural Network classifier for Hand Written Digits | ||
| 11 | + /// Sample Neural Network architecture with two layers implemented for classifying MNIST digits | ||
| 12 | + /// http://www.easy-tensorflow.com/tf-tutorials/neural-networks | ||
| 13 | + /// </summary> | ||
| 14 | + public class DigitRecognitionNN : IExample | ||
| 15 | + { | ||
| 16 | + public bool Enabled { get; set; } = true; | ||
| 17 | + public bool IsImportingGraph { get; set; } = false; | ||
| 18 | + | ||
| 19 | + public string Name => "Digits Recognition Neural Network"; | ||
| 20 | + | ||
| 21 | + const int img_h = 28; | ||
| 22 | + const int img_w = 28; | ||
| 23 | + int img_size_flat = img_h * img_w; // 784, the total number of pixels | ||
| 24 | + int n_classes = 10; // Number of classes, one class per digit | ||
| 25 | + int training_epochs = 10; | ||
| 26 | + int? train_size = null; | ||
| 27 | + int validation_size = 5000; | ||
| 28 | + int? test_size = null; | ||
| 29 | + int batch_size = 100; | ||
| 30 | + Datasets mnist; | ||
| 31 | + | ||
| 32 | + public bool Run() | ||
| 33 | + { | ||
| 34 | + PrepareData(); | ||
| 35 | + return true; | ||
| 36 | + } | ||
| 37 | + | ||
| 38 | + public Graph BuildGraph() | ||
| 39 | + { | ||
| 40 | + throw new NotImplementedException(); | ||
| 41 | + } | ||
| 42 | + | ||
| 43 | + public Graph ImportGraph() | ||
| 44 | + { | ||
| 45 | + throw new NotImplementedException(); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public bool Predict() | ||
| 49 | + { | ||
| 50 | + throw new NotImplementedException(); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public void PrepareData() | ||
| 54 | + { | ||
| 55 | + mnist = MnistDataSet.read_data_sets("mnist", one_hot: true, train_size: train_size, validation_size: validation_size, test_size: test_size); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public bool Train() | ||
| 59 | + { | ||
| 60 | + throw new NotImplementedException(); | ||
| 61 | + } | ||
| 62 | + } | ||
| 63 | + } | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -17,7 +17,7 @@ | |||
| 17 | 17 | <PackageReference Include="Newtonsoft.Json" Version="12.0.2" /> | |
| 18 | 18 | <PackageReference Include="SharpZipLib" Version="1.1.0" /> | |
| 19 | 19 | <PackageReference Include="System.Drawing.Common" Version="4.5.1" /> | |
| 20 | - <PackageReference Include="TensorFlow.NET" Version="0.8.2" /> | ||
| 20 | + <PackageReference Include="TensorFlow.NET" Version="0.8.3" /> | ||
| 21 | 21 | </ItemGroup> | |
| 22 | 22 | ||
| 23 | 23 | <ItemGroup> | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -61,11 +61,6 @@ public bool Run() | |||
| 61 | 61 | valid_y = y[new Slice(start: train_size)]; | |
| 62 | 62 | Console.WriteLine("\tDONE"); | |
| 63 | 63 | ||
| 64 | - train_x = np.Load<int[,]>(Path.Join("word_cnn", "train_x.npy")); | ||
| 65 | - valid_x = np.Load<int[,]>(Path.Join("word_cnn", "valid_x.npy")); | ||
| 66 | - train_y = np.Load<int[]>(Path.Join("word_cnn", "train_y.npy")); | ||
| 67 | - valid_y = np.Load<int[]>(Path.Join("word_cnn", "valid_y.npy")); | ||
| 68 | - | ||
| 69 | 64 | return (train_x, valid_x, train_y, valid_y); | |
| 70 | 65 | } | |
| 71 | 66 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -16,7 +16,7 @@ | |||
| 16 | 16 | </PropertyGroup> | |
| 17 | 17 | ||
| 18 | 18 | <ItemGroup> | |
| 19 | - <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.1.1" /> | ||
| 19 | + <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | ||
| 20 | 20 | <PackageReference Include="MSTest.TestAdapter" Version="1.4.0" /> | |
| 21 | 21 | <PackageReference Include="MSTest.TestFramework" Version="1.4.0" /> | |
| 22 | 22 | </ItemGroup> | |
| Back | FazBrowse Home | New Git URL |
0 commit comments