| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 09d77e2 commit c42f8bb
25 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -11,10 +11,9 @@ namespace TensorFlowNET.Examples | |||
| 11 | 11 | /// </summary> | |
| 12 | 12 | public class BasicEagerApi : IExample | |
| 13 | 13 | { | |
| 14 | - public int Priority => 100; | ||
| 15 | 14 | public bool Enabled { get; set; } = false; | |
| 16 | 15 | public string Name => "Basic Eager"; | |
| 17 | - public bool ImportGraph { get; set; } = false; | ||
| 16 | + public bool IsImportingGraph { get; set; } = false; | ||
| 18 | 17 | ||
| 19 | 18 | private Tensor a, b, c, d; | |
| 20 | 19 | ||
@@ -46,5 +45,25 @@ public bool Run() | |||
| 46 | 45 | public void PrepareData() | |
| 47 | 46 | { | |
| 48 | 47 | } | |
| 48 | + | ||
| 49 | + public Graph ImportGraph() | ||
| 50 | + { | ||
| 51 | + throw new NotImplementedException(); | ||
| 52 | + } | ||
| 53 | + | ||
| 54 | + public Graph BuildGraph() | ||
| 55 | + { | ||
| 56 | + throw new NotImplementedException(); | ||
| 57 | + } | ||
| 58 | + | ||
| 59 | + public bool Predict() | ||
| 60 | + { | ||
| 61 | + throw new NotImplementedException(); | ||
| 62 | + } | ||
| 63 | + | ||
| 64 | + public bool Train() | ||
| 65 | + { | ||
| 66 | + throw new NotImplementedException(); | ||
| 67 | + } | ||
| 49 | 68 | } | |
| 50 | 69 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,10 +18,9 @@ namespace TensorFlowNET.Examples | |||
| 18 | 18 | /// </summary> | |
| 19 | 19 | public class KMeansClustering : IExample | |
| 20 | 20 | { | |
| 21 | - public int Priority => 8; | ||
| 22 | 21 | public bool Enabled { get; set; } = true; | |
| 23 | 22 | public string Name => "K-means Clustering"; | |
| 24 | - public bool ImportGraph { get; set; } = true; | ||
| 23 | + public bool IsImportingGraph { get; set; } = true; | ||
| 25 | 24 | ||
| 26 | 25 | public int? train_size = null; | |
| 27 | 26 | public int validation_size = 5000; | |
@@ -127,5 +126,25 @@ public void PrepareData() | |||
| 127 | 126 | string url = "https://raw.githubusercontent.com/SciSharp/TensorFlow.NET/master/graph/kmeans.meta"; | |
| 128 | 127 | Web.Download(url, "graph", "kmeans.meta"); | |
| 129 | 128 | } | |
| 129 | + | ||
| 130 | + public Graph ImportGraph() | ||
| 131 | + { | ||
| 132 | + throw new NotImplementedException(); | ||
| 133 | + } | ||
| 134 | + | ||
| 135 | + public Graph BuildGraph() | ||
| 136 | + { | ||
| 137 | + throw new NotImplementedException(); | ||
| 138 | + } | ||
| 139 | + | ||
| 140 | + public bool Train() | ||
| 141 | + { | ||
| 142 | + throw new NotImplementedException(); | ||
| 143 | + } | ||
| 144 | + | ||
| 145 | + public bool Predict() | ||
| 146 | + { | ||
| 147 | + throw new NotImplementedException(); | ||
| 148 | + } | ||
| 130 | 149 | } | |
| 131 | 150 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,11 +13,9 @@ namespace TensorFlowNET.Examples | |||
| 13 | 13 | /// </summary> | |
| 14 | 14 | public class LinearRegression : IExample | |
| 15 | 15 | { | |
| 16 | - public int Priority => 3; | ||
| 17 | 16 | public bool Enabled { get; set; } = true; | |
| 18 | 17 | public string Name => "Linear Regression"; | |
| 19 | - public bool ImportGraph { get; set; } = false; | ||
| 20 | - | ||
| 18 | + public bool IsImportingGraph { get; set; } = false; | ||
| 21 | 19 | ||
| 22 | 20 | public int training_epochs = 1000; | |
| 23 | 21 | ||
@@ -113,5 +111,25 @@ public void PrepareData() | |||
| 113 | 111 | 2.827f, 3.465f, 1.65f, 2.904f, 2.42f, 2.94f, 1.3f); | |
| 114 | 112 | n_samples = train_X.shape[0]; | |
| 115 | 113 | } | |
| 114 | + | ||
| 115 | + public Graph ImportGraph() | ||
| 116 | + { | ||
| 117 | + throw new NotImplementedException(); | ||
| 118 | + } | ||
| 119 | + | ||
| 120 | + public Graph BuildGraph() | ||
| 121 | + { | ||
| 122 | + throw new NotImplementedException(); | ||
| 123 | + } | ||
| 124 | + | ||
| 125 | + public bool Train() | ||
| 126 | + { | ||
| 127 | + throw new NotImplementedException(); | ||
| 128 | + } | ||
| 129 | + | ||
| 130 | + public bool Predict() | ||
| 131 | + { | ||
| 132 | + throw new NotImplementedException(); | ||
| 133 | + } | ||
| 116 | 134 | } | |
| 117 | 135 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -18,10 +18,9 @@ namespace TensorFlowNET.Examples | |||
| 18 | 18 | /// </summary> | |
| 19 | 19 | public class LogisticRegression : IExample | |
| 20 | 20 | { | |
| 21 | - public int Priority => 4; | ||
| 22 | 21 | public bool Enabled { get; set; } = true; | |
| 23 | 22 | public string Name => "Logistic Regression"; | |
| 24 | - public bool ImportGraph { get; set; } = false; | ||
| 23 | + public bool IsImportingGraph { get; set; } = false; | ||
| 25 | 24 | ||
| 26 | 25 | ||
| 27 | 26 | public int training_epochs = 10; | |
@@ -158,5 +157,25 @@ public void Predict() | |||
| 158 | 157 | throw new ValueError("predict error, should be 90% accuracy"); | |
| 159 | 158 | }); | |
| 160 | 159 | } | |
| 160 | + | ||
| 161 | + public Graph ImportGraph() | ||
| 162 | + { | ||
| 163 | + throw new NotImplementedException(); | ||
| 164 | + } | ||
| 165 | + | ||
| 166 | + public Graph BuildGraph() | ||
| 167 | + { | ||
| 168 | + throw new NotImplementedException(); | ||
| 169 | + } | ||
| 170 | + | ||
| 171 | + public bool Train() | ||
| 172 | + { | ||
| 173 | + throw new NotImplementedException(); | ||
| 174 | + } | ||
| 175 | + | ||
| 176 | + bool IExample.Predict() | ||
| 177 | + { | ||
| 178 | + throw new NotImplementedException(); | ||
| 179 | + } | ||
| 161 | 180 | } | |
| 162 | 181 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -13,10 +13,9 @@ namespace TensorFlowNET.Examples | |||
| 13 | 13 | /// </summary> | |
| 14 | 14 | public class NaiveBayesClassifier : IExample | |
| 15 | 15 | { | |
| 16 | - public int Priority => 6; | ||
| 17 | 16 | public bool Enabled { get; set; } = true; | |
| 18 | 17 | public string Name => "Naive Bayes Classifier"; | |
| 19 | - public bool ImportGraph { get; set; } = false; | ||
| 18 | + public bool IsImportingGraph { get; set; } = false; | ||
| 20 | 19 | ||
| 21 | 20 | public NDArray X, y; | |
| 22 | 21 | public Normal dist { get; set; } | |
@@ -96,7 +95,7 @@ public void fit(NDArray X, NDArray y) | |||
| 96 | 95 | this.dist = dist; | |
| 97 | 96 | } | |
| 98 | 97 | ||
| 99 | - public Tensor predict (NDArray X) | ||
| 98 | + public Tensor predict(NDArray X) | ||
| 100 | 99 | { | |
| 101 | 100 | if (dist == null) | |
| 102 | 101 | { | |
@@ -170,5 +169,25 @@ public void PrepareData() | |||
| 170 | 169 | 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2); | |
| 171 | 170 | #endregion | |
| 172 | 171 | } | |
| 172 | + | ||
| 173 | + public Graph ImportGraph() | ||
| 174 | + { | ||
| 175 | + throw new NotImplementedException(); | ||
| 176 | + } | ||
| 177 | + | ||
| 178 | + public Graph BuildGraph() | ||
| 179 | + { | ||
| 180 | + throw new NotImplementedException(); | ||
| 181 | + } | ||
| 182 | + | ||
| 183 | + public bool Train() | ||
| 184 | + { | ||
| 185 | + throw new NotImplementedException(); | ||
| 186 | + } | ||
| 187 | + | ||
| 188 | + public bool Predict() | ||
| 189 | + { | ||
| 190 | + throw new NotImplementedException(); | ||
| 191 | + } | ||
| 173 | 192 | } | |
| 174 | 193 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -15,15 +15,14 @@ namespace TensorFlowNET.Examples | |||
| 15 | 15 | /// </summary> | |
| 16 | 16 | public class NearestNeighbor : IExample | |
| 17 | 17 | { | |
| 18 | - public int Priority => 5; | ||
| 19 | 18 | public bool Enabled { get; set; } = true; | |
| 20 | 19 | public string Name => "Nearest Neighbor"; | |
| 21 | 20 | Datasets mnist; | |
| 22 | 21 | NDArray Xtr, Ytr, Xte, Yte; | |
| 23 | 22 | public int? TrainSize = null; | |
| 24 | 23 | public int ValidationSize = 5000; | |
| 25 | 24 | public int? TestSize = null; | |
| 26 | - public bool ImportGraph { get; set; } = false; | ||
| 25 | + public bool IsImportingGraph { get; set; } = false; | ||
| 27 | 26 | ||
| 28 | 27 | ||
| 29 | 28 | public bool Run() | |
@@ -76,5 +75,25 @@ public void PrepareData() | |||
| 76 | 75 | (Xtr, Ytr) = mnist.train.next_batch(TrainSize==null ? 5000 : TrainSize.Value / 100); // 5000 for training (nn candidates) | |
| 77 | 76 | (Xte, Yte) = mnist.test.next_batch(TestSize==null ? 200 : TestSize.Value / 100); // 200 for testing | |
| 78 | 77 | } | |
| 78 | + | ||
| 79 | + public Graph ImportGraph() | ||
| 80 | + { | ||
| 81 | + throw new NotImplementedException(); | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + public Graph BuildGraph() | ||
| 85 | + { | ||
| 86 | + throw new NotImplementedException(); | ||
| 87 | + } | ||
| 88 | + | ||
| 89 | + public bool Train() | ||
| 90 | + { | ||
| 91 | + throw new NotImplementedException(); | ||
| 92 | + } | ||
| 93 | + | ||
| 94 | + public bool Predict() | ||
| 95 | + { | ||
| 96 | + throw new NotImplementedException(); | ||
| 97 | + } | ||
| 79 | 98 | } | |
| 80 | 99 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,10 +14,9 @@ namespace TensorFlowNET.Examples | |||
| 14 | 14 | /// </summary> | |
| 15 | 15 | public class NeuralNetXor : IExample | |
| 16 | 16 | { | |
| 17 | - public int Priority => 10; | ||
| 18 | 17 | public bool Enabled { get; set; } = true; | |
| 19 | 18 | public string Name => "NN XOR"; | |
| 20 | - public bool ImportGraph { get; set; } = false; | ||
| 19 | + public bool IsImportingGraph { get; set; } = false; | ||
| 21 | 20 | ||
| 22 | 21 | public int num_steps = 10000; | |
| 23 | 22 | ||
@@ -54,7 +53,7 @@ public bool Run() | |||
| 54 | 53 | { | |
| 55 | 54 | PrepareData(); | |
| 56 | 55 | float loss_value = 0; | |
| 57 | - if (ImportGraph) | ||
| 56 | + if (IsImportingGraph) | ||
| 58 | 57 | loss_value = RunWithImportedGraph(); | |
| 59 | 58 | else | |
| 60 | 59 | loss_value = RunWithBuiltGraph(); | |
@@ -145,12 +144,32 @@ public void PrepareData() | |||
| 145 | 144 | {0, 1 } | |
| 146 | 145 | }; | |
| 147 | 146 | ||
| 148 | - if (ImportGraph) | ||
| 147 | + if (IsImportingGraph) | ||
| 149 | 148 | { | |
| 150 | 149 | // download graph meta data | |
| 151 | 150 | string url = "https://raw.githubusercontent.com/SciSharp/TensorFlow.NET/master/graph/xor.meta"; | |
| 152 | 151 | Web.Download(url, "graph", "xor.meta"); | |
| 153 | 152 | } | |
| 154 | 153 | } | |
| 154 | + | ||
| 155 | + public Graph ImportGraph() | ||
| 156 | + { | ||
| 157 | + throw new NotImplementedException(); | ||
| 158 | + } | ||
| 159 | + | ||
| 160 | + public Graph BuildGraph() | ||
| 161 | + { | ||
| 162 | + throw new NotImplementedException(); | ||
| 163 | + } | ||
| 164 | + | ||
| 165 | + public bool Train() | ||
| 166 | + { | ||
| 167 | + throw new NotImplementedException(); | ||
| 168 | + } | ||
| 169 | + | ||
| 170 | + public bool Predict() | ||
| 171 | + { | ||
| 172 | + throw new NotImplementedException(); | ||
| 173 | + } | ||
| 155 | 174 | } | |
| 156 | 175 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -14,10 +14,8 @@ namespace TensorFlowNET.Examples | |||
| 14 | 14 | public class BasicOperations : IExample | |
| 15 | 15 | { | |
| 16 | 16 | public bool Enabled { get; set; } = true; | |
| 17 | - public int Priority => 2; | ||
| 18 | 17 | public string Name => "Basic Operations"; | |
| 19 | - public bool ImportGraph { get; set; } = false; | ||
| 20 | - | ||
| 18 | + public bool IsImportingGraph { get; set; } = false; | ||
| 21 | 19 | ||
| 22 | 20 | private Session sess; | |
| 23 | 21 | ||
@@ -104,5 +102,25 @@ public bool Run() | |||
| 104 | 102 | public void PrepareData() | |
| 105 | 103 | { | |
| 106 | 104 | } | |
| 105 | + | ||
| 106 | + public Graph ImportGraph() | ||
| 107 | + { | ||
| 108 | + throw new NotImplementedException(); | ||
| 109 | + } | ||
| 110 | + | ||
| 111 | + public Graph BuildGraph() | ||
| 112 | + { | ||
| 113 | + throw new NotImplementedException(); | ||
| 114 | + } | ||
| 115 | + | ||
| 116 | + public bool Train() | ||
| 117 | + { | ||
| 118 | + throw new NotImplementedException(); | ||
| 119 | + } | ||
| 120 | + | ||
| 121 | + public bool Predict() | ||
| 122 | + { | ||
| 123 | + throw new NotImplementedException(); | ||
| 124 | + } | ||
| 107 | 125 | } | |
| 108 | 126 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -12,11 +12,9 @@ namespace TensorFlowNET.Examples | |||
| 12 | 12 | /// </summary> | |
| 13 | 13 | public class HelloWorld : IExample | |
| 14 | 14 | { | |
| 15 | - public int Priority => 1; | ||
| 16 | 15 | public bool Enabled { get; set; } = true; | |
| 17 | 16 | public string Name => "Hello World"; | |
| 18 | - public bool ImportGraph { get; set; } = false; | ||
| 19 | - | ||
| 17 | + public bool IsImportingGraph { get; set; } = false; | ||
| 20 | 18 | ||
| 21 | 19 | public bool Run() | |
| 22 | 20 | { | |
@@ -41,5 +39,25 @@ of the Constant op. */ | |||
| 41 | 39 | public void PrepareData() | |
| 42 | 40 | { | |
| 43 | 41 | } | |
| 42 | + | ||
| 43 | + public Graph ImportGraph() | ||
| 44 | + { | ||
| 45 | + throw new NotImplementedException(); | ||
| 46 | + } | ||
| 47 | + | ||
| 48 | + public Graph BuildGraph() | ||
| 49 | + { | ||
| 50 | + throw new NotImplementedException(); | ||
| 51 | + } | ||
| 52 | + | ||
| 53 | + public bool Train() | ||
| 54 | + { | ||
| 55 | + throw new NotImplementedException(); | ||
| 56 | + } | ||
| 57 | + | ||
| 58 | + public bool Predict() | ||
| 59 | + { | ||
| 60 | + throw new NotImplementedException(); | ||
| 61 | + } | ||
| 44 | 62 | } | |
| 45 | 63 | } | |
| Back | FazBrowse Home | New Git URL |
0 commit comments