Skip to content

Commit bc4eea0

Browse files
committed
Using Keras for .NET v0.1.0.
1 parent 6c5183f commit bc4eea0

17 files changed

+25
-72
lines changed

SciSharp STACK Examples.sln

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,6 @@ Project("{6EC3EE1D-3C4E-46DD-8F32-0CC8E7565705}") = "TensorFlowNET.Examples.FSha
99
EndProject
1010
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "SharpCV.Exmaples", "src\SharpCV.Exmaples\SharpCV.Exmaples.csproj", "{935764FA-5297-4E49-945C-D04F1EF84EAF}"
1111
EndProject
12-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Binding", "..\TensorFlow.NET\src\TensorFlowNET.Core\Tensorflow.Binding.csproj", "{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}"
13-
EndProject
14-
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tensorflow.Keras", "..\TensorFlow.NET\src\TensorFlowNET.Keras\Tensorflow.Keras.csproj", "{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}"
15-
EndProject
1612
Global
1713
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1814
Debug|Any CPU = Debug|Any CPU
@@ -101,54 +97,6 @@ Global
10197
{935764FA-5297-4E49-945C-D04F1EF84EAF}.Release|x64.Build.0 = Release|Any CPU
10298
{935764FA-5297-4E49-945C-D04F1EF84EAF}.Release|x86.ActiveCfg = Release|Any CPU
10399
{935764FA-5297-4E49-945C-D04F1EF84EAF}.Release|x86.Build.0 = Release|Any CPU
104-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
105-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|Any CPU.Build.0 = Debug|Any CPU
106-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|x64.ActiveCfg = Debug|x64
107-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|x64.Build.0 = Debug|x64
108-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|x86.ActiveCfg = Debug|Any CPU
109-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug|x86.Build.0 = Debug|Any CPU
110-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|Any CPU.ActiveCfg = Debug|Any CPU
111-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|Any CPU.Build.0 = Debug|Any CPU
112-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|x64.ActiveCfg = Debug|x64
113-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|x64.Build.0 = Debug|x64
114-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|x86.ActiveCfg = Debug|Any CPU
115-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Debug-Minimal|x86.Build.0 = Debug|Any CPU
116-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|Any CPU.ActiveCfg = Release|Any CPU
117-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|Any CPU.Build.0 = Release|Any CPU
118-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|x64.ActiveCfg = Debug|x64
119-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|x64.Build.0 = Debug|x64
120-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|x86.ActiveCfg = Release|Any CPU
121-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Publish|x86.Build.0 = Release|Any CPU
122-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|Any CPU.ActiveCfg = Release|Any CPU
123-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|Any CPU.Build.0 = Release|Any CPU
124-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|x64.ActiveCfg = Release|x64
125-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|x64.Build.0 = Release|x64
126-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|x86.ActiveCfg = Release|Any CPU
127-
{F0DEC3F1-418F-46D4-8AC4-A0A49EB79EB4}.Release|x86.Build.0 = Release|Any CPU
128-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
129-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|Any CPU.Build.0 = Debug|Any CPU
130-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|x64.ActiveCfg = Debug|x64
131-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|x64.Build.0 = Debug|x64
132-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|x86.ActiveCfg = Debug|Any CPU
133-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug|x86.Build.0 = Debug|Any CPU
134-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|Any CPU.ActiveCfg = Debug|Any CPU
135-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|Any CPU.Build.0 = Debug|Any CPU
136-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|x64.ActiveCfg = Debug|x64
137-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|x64.Build.0 = Debug|x64
138-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|x86.ActiveCfg = Debug|Any CPU
139-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Debug-Minimal|x86.Build.0 = Debug|Any CPU
140-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|Any CPU.ActiveCfg = Release|Any CPU
141-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|Any CPU.Build.0 = Release|Any CPU
142-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|x64.ActiveCfg = Debug|x64
143-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|x64.Build.0 = Debug|x64
144-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|x86.ActiveCfg = Release|Any CPU
145-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Publish|x86.Build.0 = Release|Any CPU
146-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|Any CPU.ActiveCfg = Release|Any CPU
147-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|Any CPU.Build.0 = Release|Any CPU
148-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|x64.ActiveCfg = Release|x64
149-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|x64.Build.0 = Release|x64
150-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|x86.ActiveCfg = Release|Any CPU
151-
{520BE7D7-C0DC-4E92-A339-BDF6775E02A7}.Release|x86.Build.0 = Release|Any CPU
152100
EndGlobalSection
153101
GlobalSection(SolutionProperties) = preSolution
154102
HideSolutionNode = FALSE

src/TensorFlowNET.Examples/BasicModels/LinearRegressionEager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ limitations under the License.
1616

1717
using NumSharp;
1818
using static Tensorflow.Binding;
19-
using static Tensorflow.KerasExt;
19+
using static Tensorflow.KerasApi;
2020

2121
namespace TensorFlowNET.Examples
2222
{

src/TensorFlowNET.Examples/BasicModels/LogisticRegressionEager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ limitations under the License.
2020
using System.IO;
2121
using Tensorflow;
2222
using static Tensorflow.Binding;
23-
using static Tensorflow.KerasExt;
23+
using static Tensorflow.KerasApi;
2424

2525
namespace TensorFlowNET.Examples
2626
{

src/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCnnEager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
using Tensorflow;
2020
using Tensorflow.Keras.Optimizers;
2121
using static Tensorflow.Binding;
22-
using static Tensorflow.KerasExt;
22+
using static Tensorflow.KerasApi;
2323

2424
namespace TensorFlowNET.Examples
2525
{

src/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
using NumSharp;
1818
using Tensorflow;
1919
using static Tensorflow.Binding;
20-
using static Tensorflow.KerasExt;
20+
using static Tensorflow.KerasApi;
2121

2222
namespace TensorFlowNET.Examples
2323
{

src/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRnnKeras.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
using Tensorflow.Keras.Engine;
2222
using Tensorflow.Keras.Optimizers;
2323
using static Tensorflow.Binding;
24-
using static Tensorflow.KerasExt;
24+
using static Tensorflow.KerasApi;
2525

2626
namespace TensorFlowNET.Examples
2727
{

src/TensorFlowNET.Examples/ImageProcessing/ImageClassificationKeras.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
using Tensorflow;
33
using Tensorflow.Keras;
44
using static Tensorflow.Binding;
5-
using static Tensorflow.KerasExt;
5+
using static Tensorflow.KerasApi;
66

77
namespace TensorFlowNET.Examples
88
{

src/TensorFlowNET.Examples/ImageProcessing/MnistCnnKerasSubclass .cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ limitations under the License.
2121
using Tensorflow.Keras.Engine;
2222
using Tensorflow.Keras.Optimizers;
2323
using static Tensorflow.Binding;
24-
using static Tensorflow.KerasExt;
24+
using static Tensorflow.KerasApi;
2525

2626
namespace TensorFlowNET.Examples
2727
{

src/TensorFlowNET.Examples/ImageProcessing/MnistFnnKerasFunctional.cs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ limitations under the License.
1717
using NumSharp;
1818
using Tensorflow.Keras.Engine;
1919
using static Tensorflow.Binding;
20-
using static Tensorflow.KerasExt;
20+
using static Tensorflow.KerasApi;
2121

2222
namespace TensorFlowNET.Examples
2323
{
@@ -82,6 +82,15 @@ public override void BuildModel()
8282

8383
// train model by feeding data and labels.
8484
model.fit(x_train, y_train, batch_size: 64, epochs: 2, validation_split: 0.2f);
85+
86+
// evluate the model
87+
model.evaluate(x_test, y_test, verbose: 2);
88+
89+
// save and serialize model
90+
model.save("mnist_model");
91+
92+
// recreate the exact same model purely from the file:
93+
// model = keras.models.load_model("path_to_my_model");
8594
}
8695
}
8796
}

src/TensorFlowNET.Examples/NeuralNetworks/FullyConnectedEager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ limitations under the License.
1919
using Tensorflow;
2020
using Tensorflow.Keras.Optimizers;
2121
using static Tensorflow.Binding;
22-
using static Tensorflow.KerasExt;
22+
using static Tensorflow.KerasApi;
2323

2424
namespace TensorFlowNET.Examples
2525
{

0 commit comments

Comments
 (0)