From 6864d5c766e972998da87646ad0fa8b4c420b97c Mon Sep 17 00:00:00 2001 From: Esther2013 Date: Thu, 25 Jul 2019 16:48:22 -0500 Subject: [PATCH 1/3] remove unnecessary projects --- .../TensorFlowNET.Benchmark.csproj | 20 ++++++ test/KerasNET.Example/Keras.Example.csproj | 23 ------- test/KerasNET.Example/Keras.cs | 61 ------------------- test/KerasNET.Example/packages.config | 10 --- test/KerasNET.Test/Keras.UnitTest.csproj | 40 ------------ test/KerasNET.Test/KerasTests.cs | 26 -------- test/KerasNET.Test/packages.config | 11 ---- test/TensorFlowHub.Examples/Program.cs | 12 ---- .../TensorFlowHub.Examples.csproj | 16 ----- 9 files changed, 20 insertions(+), 199 deletions(-) create mode 100644 src/TensorFlowNet.Benchmarks/TensorFlowNET.Benchmark.csproj delete mode 100644 test/KerasNET.Example/Keras.Example.csproj delete mode 100644 test/KerasNET.Example/Keras.cs delete mode 100644 test/KerasNET.Example/packages.config delete mode 100644 test/KerasNET.Test/Keras.UnitTest.csproj delete mode 100644 test/KerasNET.Test/KerasTests.cs delete mode 100644 test/KerasNET.Test/packages.config delete mode 100644 test/TensorFlowHub.Examples/Program.cs delete mode 100644 test/TensorFlowHub.Examples/TensorFlowHub.Examples.csproj diff --git a/src/TensorFlowNet.Benchmarks/TensorFlowNET.Benchmark.csproj b/src/TensorFlowNet.Benchmarks/TensorFlowNET.Benchmark.csproj new file mode 100644 index 00000000..a0af6db4 --- /dev/null +++ b/src/TensorFlowNet.Benchmarks/TensorFlowNET.Benchmark.csproj @@ -0,0 +1,20 @@ + + + + Exe + netcoreapp2.2 + + + + + + + + + + + + + + + diff --git a/test/KerasNET.Example/Keras.Example.csproj b/test/KerasNET.Example/Keras.Example.csproj deleted file mode 100644 index 14fa0138..00000000 --- a/test/KerasNET.Example/Keras.Example.csproj +++ /dev/null @@ -1,23 +0,0 @@ - - - - Exe - netcoreapp2.2 - false - Keras.Example.Program - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/KerasNET.Example/Keras.cs b/test/KerasNET.Example/Keras.cs deleted file mode 100644 index f85fe127..00000000 --- a/test/KerasNET.Example/Keras.cs +++ /dev/null @@ -1,61 +0,0 @@ -using System; -using System.Collections.Generic; -using Tensorflow; -using Keras.Layers; -using NumSharp; - -namespace Keras.Example -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("================================== Keras =================================="); - - #region data - var batch_size = 1000; - var (X, Y) = XOR(batch_size); - //var (X, Y, batch_size) = (np.array(new float[,]{{1, 0 },{1, 1 },{0, 0 },{0, 1 }}), np.array(new int[] { 0, 1, 1, 0 }), 4); - #endregion - - #region features - var (features, labels) = (new Tensor(X), new Tensor(Y)); - var num_steps = 10000; - #endregion - - #region model - var m = new Model(); - - //m.Add(new Dense(8, name: "Hidden", activation: tf.nn.relu())).Add(new Dense(1, name:"Output")); - - m.Add( - new ILayer[] { - new Dense(8, name: "Hidden_1", activation: tf.nn.relu()), - new Dense(1, name: "Output") - }); - - m.train(num_steps, (X, Y)); - #endregion - - Console.ReadKey(); - } - static (NDArray, NDArray) XOR(int samples) - { - var X = new List(); - var Y = new List(); - var r = new Random(); - for (int i = 0; i < samples; i++) - { - var x1 = (float)r.Next(0, 2); - var x2 = (float)r.Next(0, 2); - var y = 0.0f; - if (x1 == x2) - y = 1.0f; - X.Add(new float[] { x1, x2 }); - Y.Add(y); - } - - return (np.array(X.ToArray()), np.array(Y.ToArray())); - } - } -} diff --git a/test/KerasNET.Example/packages.config b/test/KerasNET.Example/packages.config deleted file mode 100644 index e7c17277..00000000 --- a/test/KerasNET.Example/packages.config +++ /dev/null @@ -1,10 +0,0 @@ - - - - - - - - - - \ No newline at end of file diff --git a/test/KerasNET.Test/Keras.UnitTest.csproj b/test/KerasNET.Test/Keras.UnitTest.csproj deleted file mode 100644 index e5956a96..00000000 --- a/test/KerasNET.Test/Keras.UnitTest.csproj +++ /dev/null @@ -1,40 +0,0 @@ - - - - netcoreapp2.2 - - false - - Keras.UnitTest - - Keras.UnitTest - - - - Exe - - - - - - DEBUG;TRACE - true - - - - true - - - - - - - - - - - - - - - diff --git a/test/KerasNET.Test/KerasTests.cs b/test/KerasNET.Test/KerasTests.cs deleted file mode 100644 index 05cde48c..00000000 --- a/test/KerasNET.Test/KerasTests.cs +++ /dev/null @@ -1,26 +0,0 @@ -using Tensorflow; -using Keras.Layers; -using NumSharp; -using Microsoft.VisualStudio.TestTools.UnitTesting; - -namespace Keras.Test -{ - [TestClass] - public class BaseTests - { - [TestMethod] - public void Dense_Tensor_ShapeTest() - { - var dense_1 = new Dense(1, name: "dense_1", activation: tf.nn.relu()); - var input = new Tensor(np.array(new int[] { 3 })); - dense_1.__build__(input.TensorShape); - var outputShape = dense_1.output_shape(input.TensorShape); - var a = (int[])(outputShape.Dimensions); - var b = (int[])(new int[] { 1 }); - var _a = np.array(a); - var _b = np.array(b); - - Assert.IsTrue(np.array_equal(_a, _b)); - } - } -} diff --git a/test/KerasNET.Test/packages.config b/test/KerasNET.Test/packages.config deleted file mode 100644 index 7e0fea67..00000000 --- a/test/KerasNET.Test/packages.config +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/test/TensorFlowHub.Examples/Program.cs b/test/TensorFlowHub.Examples/Program.cs deleted file mode 100644 index 3fdbad12..00000000 --- a/test/TensorFlowHub.Examples/Program.cs +++ /dev/null @@ -1,12 +0,0 @@ -using System; - -namespace TensorFlowHub.Examples -{ - class Program - { - static void Main(string[] args) - { - Console.WriteLine("Hello World!"); - } - } -} diff --git a/test/TensorFlowHub.Examples/TensorFlowHub.Examples.csproj b/test/TensorFlowHub.Examples/TensorFlowHub.Examples.csproj deleted file mode 100644 index ae01aa36..00000000 --- a/test/TensorFlowHub.Examples/TensorFlowHub.Examples.csproj +++ /dev/null @@ -1,16 +0,0 @@ - - - - Exe - netcoreapp2.2 - - - - - - - - - - - From c1ac68c9571a9b3ff4eb8f08303c04cb998e12e9 Mon Sep 17 00:00:00 2001 From: Haiping Chen Date: Wed, 2 Oct 2019 07:09:53 -0500 Subject: [PATCH 2/3] Update FUNDING.yml --- .github/FUNDING.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 4d112805..fdf00590 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -9,4 +9,4 @@ community_bridge: # Replace with a single Community Bridge project-name e.g., cl liberapay: # Replace with a single Liberapay username issuehunt: # Replace with a single IssueHunt username otechie: # Replace with a single Otechie username -custom: ['https://paypal.me/pools/c/8fK9eKwbbL']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] +custom: ['https://bit.ly/2op1mu5']# Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2'] From b4aaa2676b8de34d757937203e58db06eb512992 Mon Sep 17 00:00:00 2001 From: Esther2013 Date: Wed, 2 Oct 2019 09:49:59 -0500 Subject: [PATCH 3/3] add Redist-Linux NuGet script --- src/SciSharp.TensorFlow.Redist/README.md | 5 +- ...harp.TensorFlow.Redist-Linux-GPU.nupkgproj | 174 ++++++++++++++++++ 2 files changed, 176 insertions(+), 3 deletions(-) create mode 100644 src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist-Linux-GPU.nupkgproj diff --git a/src/SciSharp.TensorFlow.Redist/README.md b/src/SciSharp.TensorFlow.Redist/README.md index 5bdf82a1..9101f422 100644 --- a/src/SciSharp.TensorFlow.Redist/README.md +++ b/src/SciSharp.TensorFlow.Redist/README.md @@ -10,7 +10,7 @@ PM> Install-Package SciSharp.TensorFlow.Redist * GPU version for Windows ```powershell -PM> Install-Package SciSharp.TensorFlow.Redist +PM> Install-Package SciSharp.TensorFlow.Redist-Windows-GPU ``` https://www.nuget.org/packages/SciSharp.TensorFlow.Redist @@ -21,8 +21,7 @@ Related merged [commits](https://github.com/SciSharp/TensorFlow.NET/commit/854a5 On Windows, the tar command does not support extracting archives with symlinks. So when `dotnet pack` runs on Windows it will only package the Windows binaries. -1. Run `dotnet pack` under `src/SciSharp.TensorFlow.Redist` directory in Linux. +1. Run `dotnet pack SciSharp.TensorFlow.Redist-CPU.nupkgproj` under `src/SciSharp.TensorFlow.Redist` directory in Linux. 2. Run `dotnet nuget push SciSharp.TensorFlow.Redist.1.14.0.nupkg -k APIKEY -s https://api.nuget.org/v3/index.json` - diff --git a/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist-Linux-GPU.nupkgproj b/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist-Linux-GPU.nupkgproj new file mode 100644 index 00000000..c2a819a3 --- /dev/null +++ b/src/SciSharp.TensorFlow.Redist/SciSharp.TensorFlow.Redist-Linux-GPU.nupkgproj @@ -0,0 +1,174 @@ + + + + $(MSBuildThisFileDirectory) + $(ProjDir)bin\ + $(ProjDir)obj\ + + x64 + netstandard2.0 + 1.14.0 + 1 + + $(BinDir)packages\ + $(MSBuildProjectName) + $(TensorFlowVersion) + + true + false + + Redist-Windows-GPU.nuspec + packageId=$(PackageId);version=$(PackageVersion) + $(ProjDir) + + CopyFilesFromArchive + + win + linux + osx + $(PackageRid)-$(TargetArchitecture) + + + + + false + + + + + + + + + + + + + + + + + + + + + + <_downloadFiles Include="@(TensorFlowArchive);@(AdditionalDownloadFile)" Url="%(Identity)" DestinationFile="%(DownloadFile)" /> + + + + + + + + + + + + + + + + + + + + + + @(FilesWithHashes->'%(FileHash)') + $([System.IO.File]::ReadAllText('%(LocalShaFile)').Replace("%0A", "").Replace("%0D", "")) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + <_fileFromArchive Include="%(TensorFlowArchive.FilesFromArchive)" ExtractDirectory="%(TensorFlowArchive.ExtractDirectory)" Runtime="%(TensorFlowArchive.Runtime)" /> + <_fileFromArchive DestinationFile="%(FileName)%(Extension)"/> + <_fileFromArchive PackagePath="runtimes\%(_fileFromArchive.Runtime)\native\%(_fileFromArchive.DestinationFile)" /> + + + <_fileFromArchive Condition="'%(DestinationFile)' == 'LICENSE'" PackagePath="THIRD_PARTY_NOTICES.txt" Runtime="" /> + + + + + + + + + + + + + + + + + + + + + + + +