Skip to content

Commit

Permalink
Working on adding tf support. Using tf.kers 2.12 APIs for building
Browse files Browse the repository at this point in the history
  • Loading branch information
deepakkumar1984 committed Apr 23, 2023
1 parent 2ea442d commit 887cebb
Show file tree
Hide file tree
Showing 6 changed files with 61 additions and 5 deletions.
38 changes: 36 additions & 2 deletions Keras.NET.sln
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29123.88
# Visual Studio Version 17
VisualStudioVersion = 17.5.33502.453
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Keras.UnitTest", "Keras.UnitTest\Keras.UnitTest.csproj", "{0B402B43-29A2-4564-BC20-20BBBE7C2C51}"
EndProject
Expand All @@ -23,6 +23,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "KerasExampleWinApp", "Examp
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "MusicGeneration", "Examples\MusicGeneration\MusicGeneration.csproj", "{108C3326-58D2-4C26-9D78-5F045D620A26}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Tensorflow", "Tensorflow\Tensorflow.csproj", "{27230C96-FCB4-406C-8AAD-450020F9074D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -317,6 +319,38 @@ Global
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|Any CPU.Build.0 = Release|Any CPU
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|x64.ActiveCfg = Release|Any CPU
{108C3326-58D2-4C26-9D78-5F045D620A26}.Release|x64.Build.0 = Release|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Debug|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_Mono|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_OSX|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py2.7_WIN|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_Mono|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_OSX|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|Any CPU.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|Any CPU.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|x64.ActiveCfg = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Py3.6_WIN|x64.Build.0 = Debug|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|Any CPU.Build.0 = Release|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|x64.ActiveCfg = Release|Any CPU
{27230C96-FCB4-406C-8AAD-450020F9074D}.Release|x64.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
1 change: 1 addition & 0 deletions Keras/Keras.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
</ItemGroup>

<ItemGroup>
<Folder Include="tf\" />
<Folder Include="Properties\"></Folder>
</ItemGroup>

Expand Down
2 changes: 1 addition & 1 deletion Keras/Layers/Core.cs
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ public class Input : BaseLayer
/// <param name="dtype">The data type expected by the input, as a string (float32, float64, int32...)</param>
/// <param name="sparse"> A boolean specifying whether the placeholder to be created is sparse.</param>
/// <param name="tensor">Optional existing tensor to wrap into the Input layer. If set, the layer will not create a placeholder tensor.</param>
public Input(Shape shape, Shape batch_shape = null, string name = "", string dtype = "float32", bool sparse = false, NDarray tensor = null)
public Input(Shape shape, Shape batch_shape = null, string name = "", string dtype = "float32", bool sparse = false, NDarray tensor = null, bool? ragged = null)
{
this["shape"] = shape;
this["batch_shape"] = batch_shape;
Expand Down
5 changes: 3 additions & 2 deletions Keras/Models/Model.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ internal Model(PyObject obj)
/// </summary>
/// <param name="inputs">The inputs layers.</param>
/// <param name="outputs">The outputs layers.</param>
public Model(BaseLayer[] inputs, BaseLayer[] outputs)
/// <param name="name">The layer name.</param>
public Model(BaseLayer[] inputs, BaseLayer[] outputs, string name = null)
{
List<PyObject> inputList = new List<PyObject>();
List<PyObject> outputList = new List<PyObject>();
Expand All @@ -49,7 +50,7 @@ public Model(BaseLayer[] inputs, BaseLayer[] outputs)
outputList.Add(item.PyInstance);
}

PyInstance = Instance.keras.models.Model(inputList, outputList);
PyInstance = Instance.keras.models.Model(inputList, outputList, name);
}

/// <summary>
Expand Down
9 changes: 9 additions & 0 deletions Tensorflow/TensorSpec.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
using System;

namespace Tensorflow
{
public class TensorSpec
{

}
}
11 changes: 11 additions & 0 deletions Tensorflow/Tensorflow.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netstandard2.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Numpy.Bare" Version="3.11.1.33" />
</ItemGroup>

</Project>

0 comments on commit 887cebb

Please sign in to comment.