| @@ -11,6 +11,8 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "UnitTest", "test\TensorFlow | |||||
| EndProject | EndProject | ||||
| Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Keras", "src\TensorFlowNET.Keras\Tensorflow.Keras.csproj", "{6268B461-486A-460B-9B3C-86493CBBAAF7}" | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Keras", "src\TensorFlowNET.Keras\Tensorflow.Keras.csproj", "{6268B461-486A-460B-9B3C-86493CBBAAF7}" | ||||
| EndProject | EndProject | ||||
| Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tensorflow.Keras.UnitTest", "test\Tensorflow.Keras.UnitTest\Tensorflow.Keras.UnitTest.csproj", "{EB92DD90-6346-41FB-B967-2B33A860AD98}" | |||||
| EndProject | |||||
| Global | Global | ||||
| GlobalSection(SolutionConfigurationPlatforms) = preSolution | GlobalSection(SolutionConfigurationPlatforms) = preSolution | ||||
| Debug|Any CPU = Debug|Any CPU | Debug|Any CPU = Debug|Any CPU | ||||
| @@ -51,6 +53,14 @@ Global | |||||
| {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|Any CPU.Build.0 = Release|Any CPU | {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|Any CPU.Build.0 = Release|Any CPU | ||||
| {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|x64.ActiveCfg = Release|Any CPU | {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|x64.ActiveCfg = Release|Any CPU | ||||
| {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|x64.Build.0 = Release|Any CPU | {6268B461-486A-460B-9B3C-86493CBBAAF7}.Release|x64.Build.0 = Release|Any CPU | ||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Debug|Any CPU.ActiveCfg = Debug|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Debug|Any CPU.Build.0 = Debug|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Debug|x64.ActiveCfg = Debug|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Debug|x64.Build.0 = Debug|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Release|Any CPU.ActiveCfg = Release|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Release|Any CPU.Build.0 = Release|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Release|x64.ActiveCfg = Release|Any CPU | |||||
| {EB92DD90-6346-41FB-B967-2B33A860AD98}.Release|x64.Build.0 = Release|Any CPU | |||||
| EndGlobalSection | EndGlobalSection | ||||
| GlobalSection(SolutionProperties) = preSolution | GlobalSection(SolutionProperties) = preSolution | ||||
| HideSolutionNode = FALSE | HideSolutionNode = FALSE | ||||
| @@ -20,7 +20,7 @@ namespace Tensorflow.Keras.Engine | |||||
| } | } | ||||
| public void enter(Layer layer, Tensor[] inputs, Graph build_graph, bool training, Saving saving = null) => throw new NotImplementedException(); | |||||
| public void enter(Layer layer, Tensor[] inputs, Graph build_graph, bool training) => throw new NotImplementedException(); | |||||
| public bool training_arg_passed_to_call(string[] argspec, Dictionary<string, object> args, Dictionary<string, object> kwargs) => throw new NotImplementedException(); | public bool training_arg_passed_to_call(string[] argspec, Dictionary<string, object> args, Dictionary<string, object> kwargs) => throw new NotImplementedException(); | ||||
| @@ -1,10 +0,0 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras.Engine | |||||
| { | |||||
| public class Saving | |||||
| { | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,43 @@ | |||||
| using System; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class KwArgs | |||||
| { | |||||
| private Dictionary<string, object> args = new Dictionary<string, object>(); | |||||
| public object this[string name] | |||||
| { | |||||
| get | |||||
| { | |||||
| return args.ContainsKey(name) ? args[name] : null; | |||||
| } | |||||
| set | |||||
| { | |||||
| args[name] = value; | |||||
| } | |||||
| } | |||||
| public T Get<T>(string name) | |||||
| { | |||||
| if (!args.ContainsKey(name)) | |||||
| return default(T); | |||||
| return (T)args[name]; | |||||
| } | |||||
| public static explicit operator KwArgs(ValueTuple<string, object>[] p) | |||||
| { | |||||
| KwArgs kwArgs = new KwArgs(); | |||||
| kwArgs.args = new Dictionary<string, object>(); | |||||
| foreach (var item in p) | |||||
| { | |||||
| kwArgs.args[item.Item1] = item.Item2; | |||||
| } | |||||
| return kwArgs; | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Adadelta : Optimizer | |||||
| { | |||||
| public Adadelta(float lr= 0.01f, float rho = 0.95f, float? epsilon = null, float decay = 0) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Adagrad : Optimizer | |||||
| { | |||||
| public Adagrad(float lr= 0.01f, float? epsilon = null, float decay = 0) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Adam : Optimizer | |||||
| { | |||||
| public Adam(float lr= 0.001f, float beta_1 = 0.9f, float beta_2 = 0.99f, float? epsilon = null, float decay = 0) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Adamax : Optimizer | |||||
| { | |||||
| public Adamax(float lr = 0.002f, float beta_1 = 0.9f, float beta_2 = 0.999f, float? epsilon = null, float decay = 0) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Nadam : Optimizer | |||||
| { | |||||
| public Nadam(float lr = 0.002f, float beta_1 = 0.9f, float beta_2 = 0.999f, float? epsilon = null, float schedule_decay = 0.004f) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,36 @@ | |||||
| using NumSharp; | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class Optimizer | |||||
| { | |||||
| public Optimizer(KwArgs kwargs) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public virtual Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| return null; | |||||
| } | |||||
| public virtual Tensor[] get_gradients(Tensor loss, variables @params) => throw new NotImplementedException(); | |||||
| public virtual void set_weights(NDArray[] weights) => throw new NotImplementedException(); | |||||
| public virtual NDArray[] get_weights() => throw new NotImplementedException(); | |||||
| public virtual Hashtable get_config() => throw new NotImplementedException(); | |||||
| public static string serialize(Optimizer optimizer) => throw new NotImplementedException(); | |||||
| public static string deserialize(string config, object custom_objects = null) => throw new NotImplementedException(); | |||||
| public static Optimizer get(object identifier) => throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class RMSprop : Optimizer | |||||
| { | |||||
| public RMSprop(float lr= 0.01f, float rho = 0f, float? epsilon = null, float decay = 0) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,25 @@ | |||||
| using System; | |||||
| using System.Collections; | |||||
| using System.Collections.Generic; | |||||
| using System.Text; | |||||
| namespace Tensorflow.Keras | |||||
| { | |||||
| public class SGD : Optimizer | |||||
| { | |||||
| public SGD(float lr= 0.01f, float momentum= 0, float decay= 0, bool nesterov= false) : base(null) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Tensor[] get_updates(Tensor loss, variables @params) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -4,7 +4,7 @@ using System.Text; | |||||
| namespace Tensorflow.Keras.OptimizersV2 | namespace Tensorflow.Keras.OptimizersV2 | ||||
| { | { | ||||
| class BaseOptimizerV2 | |||||
| class OptimizerV2 | |||||
| { | { | ||||
| } | } | ||||
| } | } | ||||
| @@ -1,10 +1,25 @@ | |||||
| using System; | using System; | ||||
| using System.Collections; | |||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Text; | using System.Text; | ||||
| namespace Tensorflow.Keras.Regularizers | namespace Tensorflow.Keras.Regularizers | ||||
| { | { | ||||
| class L1L2 | |||||
| public class L1L2 : Regularizer | |||||
| { | { | ||||
| public L1L2(float l1 = 0f, float l2 = 0f) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override float call(Tensor x) | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| public override Hashtable get_config() | |||||
| { | |||||
| throw new NotImplementedException(); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,10 +1,40 @@ | |||||
| using System; | using System; | ||||
| using System.Collections; | |||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||
| using System.Text; | using System.Text; | ||||
| namespace Tensorflow.Keras.Regularizers | namespace Tensorflow.Keras.Regularizers | ||||
| { | { | ||||
| public class Regularizer | |||||
| public abstract class Regularizer | |||||
| { | { | ||||
| public virtual float call(Tensor x) | |||||
| { | |||||
| return 0f; | |||||
| } | |||||
| public static Regularizer from_config(Hashtable hashtable) => throw new NotImplementedException(); | |||||
| public virtual Hashtable get_config() => throw new NotImplementedException(); | |||||
| public static Regularizer l1(float l = 0.01f) | |||||
| { | |||||
| return new L1L2(l1: l); | |||||
| } | |||||
| public static Regularizer l2(float l = 0.01f) | |||||
| { | |||||
| return new L1L2(l2: l); | |||||
| } | |||||
| public static Regularizer l1_l2(float l1 = 0.01f, float l2 = 0.01f) | |||||
| { | |||||
| return new L1L2(l1, l2); | |||||
| } | |||||
| public static string serialize(Regularizer regularizer) => throw new NotImplementedException(); | |||||
| public static string deserialize(string config, dynamic custom_objects = null) => throw new NotImplementedException(); | |||||
| public static Regularizer get(object identifier) => throw new NotImplementedException(); | |||||
| } | } | ||||
| } | } | ||||
| @@ -0,0 +1,14 @@ | |||||
| using Microsoft.VisualStudio.TestTools.UnitTesting; | |||||
| using System.Collections.Generic; | |||||
| namespace Tensorflow.Keras.UnitTest | |||||
| { | |||||
| [TestClass] | |||||
| public class OptimizerTest | |||||
| { | |||||
| [TestMethod] | |||||
| public void BaseConstruct() | |||||
| { | |||||
| } | |||||
| } | |||||
| } | |||||
| @@ -0,0 +1,20 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | |||||
| <PropertyGroup> | |||||
| <TargetFramework>netcoreapp3.1</TargetFramework> | |||||
| <IsPackable>false</IsPackable> | |||||
| </PropertyGroup> | |||||
| <ItemGroup> | |||||
| <PackageReference Include="Microsoft.NET.Test.Sdk" Version="16.2.0" /> | |||||
| <PackageReference Include="MSTest.TestAdapter" Version="2.0.0" /> | |||||
| <PackageReference Include="MSTest.TestFramework" Version="2.0.0" /> | |||||
| <PackageReference Include="coverlet.collector" Version="1.0.1" /> | |||||
| </ItemGroup> | |||||
| <ItemGroup> | |||||
| <ProjectReference Include="..\..\src\TensorFlowNET.Keras\Tensorflow.Keras.csproj" /> | |||||
| </ItemGroup> | |||||
| </Project> | |||||