| @@ -7,5 +7,7 @@ namespace Tensorflow.Keras | |||||
| public interface IInitializersApi | public interface IInitializersApi | ||||
| { | { | ||||
| IInitializer Orthogonal(float gain = 1.0f, int? seed = null); | IInitializer Orthogonal(float gain = 1.0f, int? seed = null); | ||||
| IInitializer HeNormal(int? seed = null); | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,11 +1,11 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
| <PropertyGroup> | <PropertyGroup> | ||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks> | |||||
| <AssemblyName>Tensorflow.Binding</AssemblyName> | <AssemblyName>Tensorflow.Binding</AssemblyName> | ||||
| <RootNamespace>Tensorflow</RootNamespace> | <RootNamespace>Tensorflow</RootNamespace> | ||||
| <TargetTensorFlow>2.2.0</TargetTensorFlow> | |||||
| <Version>0.100.0</Version> | |||||
| <TargetTensorFlow>2.10.0</TargetTensorFlow> | |||||
| <Version>0.100.1</Version> | |||||
| <LangVersion>10.0</LangVersion> | <LangVersion>10.0</LangVersion> | ||||
| <Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
| <Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | <Authors>Haiping Chen, Meinrad Recheis, Eli Belash</Authors> | ||||
| @@ -20,7 +20,7 @@ | |||||
| <Description>Google's TensorFlow full binding in .NET Standard. | <Description>Google's TensorFlow full binding in .NET Standard. | ||||
| Building, training and infering deep learning models. | Building, training and infering deep learning models. | ||||
| https://tensorflownet.readthedocs.io</Description> | https://tensorflownet.readthedocs.io</Description> | ||||
| <AssemblyVersion>0.100.0.0</AssemblyVersion> | |||||
| <AssemblyVersion>0.100.1.0</AssemblyVersion> | |||||
| <PackageReleaseNotes> | <PackageReleaseNotes> | ||||
| tf.net 0.100.x and above are based on tensorflow native 2.10.0 | tf.net 0.100.x and above are based on tensorflow native 2.10.0 | ||||
| @@ -38,7 +38,7 @@ https://tensorflownet.readthedocs.io</Description> | |||||
| tf.net 0.7x.x aligns with TensorFlow v2.7.x native library. | tf.net 0.7x.x aligns with TensorFlow v2.7.x native library. | ||||
| tf.net 0.10x.x aligns with TensorFlow v2.10.x native library. | tf.net 0.10x.x aligns with TensorFlow v2.10.x native library. | ||||
| </PackageReleaseNotes> | </PackageReleaseNotes> | ||||
| <FileVersion>0.100.0.0</FileVersion> | |||||
| <FileVersion>0.100.1.0</FileVersion> | |||||
| <PackageLicenseFile>LICENSE</PackageLicenseFile> | <PackageLicenseFile>LICENSE</PackageLicenseFile> | ||||
| <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | <PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance> | ||||
| <SignAssembly>true</SignAssembly> | <SignAssembly>true</SignAssembly> | ||||
| @@ -108,7 +108,7 @@ https://tensorflownet.readthedocs.io</Description> | |||||
| <ItemGroup> | <ItemGroup> | ||||
| <PackageReference Include="MethodBoundaryAspect.Fody" Version="2.0.148" /> | <PackageReference Include="MethodBoundaryAspect.Fody" Version="2.0.148" /> | ||||
| <PackageReference Include="Protobuf.Text" Version="0.5.0" /> | |||||
| <PackageReference Include="Protobuf.Text" Version="0.6.0" /> | |||||
| <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" /> | <PackageReference Include="Serilog.Sinks.Console" Version="4.1.0" /> | ||||
| </ItemGroup> | </ItemGroup> | ||||
| </Project> | </Project> | ||||
| @@ -65,12 +65,7 @@ namespace Tensorflow.Keras.Engine | |||||
| } | } | ||||
| // Keep track of the network's nodes and layers. | // Keep track of the network's nodes and layers. | ||||
| (NetworkNodes, NodesByDepth, var layers, _) = MapGraphNetwork(inputs, outputs); | |||||
| if (!_self_tracked_trackables.Any()) | |||||
| { | |||||
| _self_tracked_trackables = layers; | |||||
| } | |||||
| (NetworkNodes, NodesByDepth, _self_tracked_trackables, _) = MapGraphNetwork(inputs, outputs); | |||||
| // Build self.input_names and self.output_names. | // Build self.input_names and self.output_names. | ||||
| _set_output_names(); | _set_output_names(); | ||||
| @@ -110,6 +110,8 @@ namespace Tensorflow.Keras.Engine | |||||
| } | } | ||||
| else if (outputs != null) | else if (outputs != null) | ||||
| { | { | ||||
| // If the model is being built continuously on top of an input layer: | |||||
| // refresh its output. | |||||
| outputs = layer.Apply(outputs); | outputs = layer.Apply(outputs); | ||||
| built = true; | built = true; | ||||
| } | } | ||||
| @@ -155,7 +157,7 @@ namespace Tensorflow.Keras.Engine | |||||
| Tensors layer_output = null; | Tensors layer_output = null; | ||||
| Tensors outputs = null; | Tensors outputs = null; | ||||
| List<INode> created_nodes = new List<INode>(); | List<INode> created_nodes = new List<INode>(); | ||||
| foreach (var layer in _self_tracked_trackables) | |||||
| foreach (var layer in args.Layers) | |||||
| { | { | ||||
| clear_previously_created_nodes(layer, _created_nodes); | clear_previously_created_nodes(layer, _created_nodes); | ||||
| layer_output = layer.Apply(layer_input); | layer_output = layer.Apply(layer_input); | ||||
| @@ -25,7 +25,7 @@ public partial class InitializersApi : IInitializersApi | |||||
| /// </summary> | /// </summary> | ||||
| /// <param name="seed"></param> | /// <param name="seed"></param> | ||||
| /// <returns></returns> | /// <returns></returns> | ||||
| public IInitializer he_normal(int? seed = null) | |||||
| public IInitializer HeNormal(int? seed = null) | |||||
| { | { | ||||
| return new VarianceScaling(factor: 2.0f, mode: "fan_in", seed: seed); | return new VarianceScaling(factor: 2.0f, mode: "fan_in", seed: seed); | ||||
| } | } | ||||
| @@ -45,6 +45,11 @@ namespace Tensorflow.Keras.Layers.Rnn | |||||
| } | } | ||||
| } | } | ||||
| protected override Tensors Call(Tensors inputs, Tensor state = null, bool? training = null) | |||||
| { | |||||
| return base.Call(inputs, state, training); | |||||
| } | |||||
| private static RNNArgs PreConstruct(RNNArgs args) | private static RNNArgs PreConstruct(RNNArgs args) | ||||
| { | { | ||||
| if (args.Kwargs == null) | if (args.Kwargs == null) | ||||
| @@ -33,11 +33,16 @@ namespace Tensorflow.Keras.Layers.Rnn | |||||
| if (args.UseBias) | if (args.UseBias) | ||||
| { | { | ||||
| bias = add_weight("bias", (args.Units), | bias = add_weight("bias", (args.Units), | ||||
| initializer: args.RecurrentInitializer | |||||
| initializer: args.BiasInitializer | |||||
| ); | ); | ||||
| } | } | ||||
| built = true; | built = true; | ||||
| } | } | ||||
| protected override Tensors Call(Tensors inputs, Tensor state = null, bool? training = null) | |||||
| { | |||||
| return base.Call(inputs, state, training); | |||||
| } | |||||
| } | } | ||||
| } | } | ||||
| @@ -1,13 +1,13 @@ | |||||
| <Project Sdk="Microsoft.NET.Sdk"> | <Project Sdk="Microsoft.NET.Sdk"> | ||||
| <PropertyGroup> | <PropertyGroup> | ||||
| <TargetFramework>netstandard2.0</TargetFramework> | |||||
| <TargetFrameworks>netstandard2.0;net6.0</TargetFrameworks> | |||||
| <AssemblyName>Tensorflow.Keras</AssemblyName> | <AssemblyName>Tensorflow.Keras</AssemblyName> | ||||
| <LangVersion>10.0</LangVersion> | <LangVersion>10.0</LangVersion> | ||||
| <Nullable>enable</Nullable> | <Nullable>enable</Nullable> | ||||
| <RootNamespace>Tensorflow.Keras</RootNamespace> | <RootNamespace>Tensorflow.Keras</RootNamespace> | ||||
| <Platforms>AnyCPU;x64</Platforms> | <Platforms>AnyCPU;x64</Platforms> | ||||
| <Version>0.10.0</Version> | |||||
| <Version>0.10.1</Version> | |||||
| <Authors>Haiping Chen</Authors> | <Authors>Haiping Chen</Authors> | ||||
| <Product>Keras for .NET</Product> | <Product>Keras for .NET</Product> | ||||
| <Copyright>Apache 2.0, Haiping Chen 2021</Copyright> | <Copyright>Apache 2.0, Haiping Chen 2021</Copyright> | ||||
| @@ -37,8 +37,8 @@ Keras is an API designed for human beings, not machines. Keras follows best prac | |||||
| <RepositoryType>Git</RepositoryType> | <RepositoryType>Git</RepositoryType> | ||||
| <SignAssembly>true</SignAssembly> | <SignAssembly>true</SignAssembly> | ||||
| <AssemblyOriginatorKeyFile>Open.snk</AssemblyOriginatorKeyFile> | <AssemblyOriginatorKeyFile>Open.snk</AssemblyOriginatorKeyFile> | ||||
| <AssemblyVersion>0.10.0.0</AssemblyVersion> | |||||
| <FileVersion>0.10.0.0</FileVersion> | |||||
| <AssemblyVersion>0.10.1.0</AssemblyVersion> | |||||
| <FileVersion>0.10.1.0</FileVersion> | |||||
| <PackageLicenseFile>LICENSE</PackageLicenseFile> | <PackageLicenseFile>LICENSE</PackageLicenseFile> | ||||
| <Configurations>Debug;Release;GPU</Configurations> | <Configurations>Debug;Release;GPU</Configurations> | ||||
| </PropertyGroup> | </PropertyGroup> | ||||