Browse Source

Add TensorFlowDatasets project.

tags/v0.12
Oceania2018 6 years ago
parent
commit
cffc950509
11 changed files with 140 additions and 6 deletions
  1. +7
    -1
      TensorFlow.NET.sln
  2. +24
    -0
      src/TensorFlowDatasets/DatasetBuilder.cs
  3. +10
    -0
      src/TensorFlowDatasets/DownloadConfig.cs
  4. +19
    -0
      src/TensorFlowDatasets/TensorFlowDatasets.csproj
  5. +74
    -0
      test/TensorFlowNET.Examples/ImageProcessing/CIFAR10-CNN.cs
  6. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs
  7. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionNN.cs
  8. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs
  9. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/ImageBackgroundRemoval.cs
  10. +1
    -1
      test/TensorFlowNET.Examples/ImageProcessing/RetrainImageClassifier.cs
  11. +1
    -0
      test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj

+ 7
- 1
TensorFlow.NET.sln View File

@@ -17,7 +17,9 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowBenchmark", "src\
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowHub", "src\TensorFlowHub\TensorFlowHub.csproj", "{8FD59A5A-97EB-457E-B9F1-D88B0C822C6E}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TensorFlowText", "src\TensorFlowText\TensorFlowText.csproj", "{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TensorFlowText", "src\TensorFlowText\TensorFlowText.csproj", "{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TensorFlowDatasets", "src\TensorFlowDatasets\TensorFlowDatasets.csproj", "{DF151A51-E9FD-41BD-B0F4-08A743755D44}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -57,6 +59,10 @@ Global
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B598E5D5-BD2D-4191-8532-F2FBAC31AB81}.Release|Any CPU.Build.0 = Release|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DF151A51-E9FD-41BD-B0F4-08A743755D44}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE


+ 24
- 0
src/TensorFlowDatasets/DatasetBuilder.cs View File

@@ -0,0 +1,24 @@
using System;

namespace TensorFlowDatasets
{
/// <summary>
/// Abstract base class for all datasets.
/// </summary>
public class DatasetBuilder
{
/// <summary>
/// Downloads and prepares dataset for reading.
/// </summary>
/// <param name="download_dir">
/// directory where downloaded files are stored.
/// </param>
/// <param name="download_config">
/// further configuration for downloading and preparing dataset.
/// </param>
public void download_and_prepare(string download_dir = null, DownloadConfig download_config = null)
{

}
}
}

+ 10
- 0
src/TensorFlowDatasets/DownloadConfig.cs View File

@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace TensorFlowDatasets
{
public class DownloadConfig
{
}
}

+ 19
- 0
src/TensorFlowDatasets/TensorFlowDatasets.csproj View File

@@ -0,0 +1,19 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFramework>netcoreapp2.2</TargetFramework>
<PackageId>SciSharp.TensorFlowDatasets</PackageId>
<Version>0.0.1</Version>
<Authors>SciSharp Team</Authors>
<Product>TensorFlow Datasets</Product>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<PackageIconUrl>https://avatars3.githubusercontent.com/u/44989469?s=200&amp;v=4</PackageIconUrl>
<PackageProjectUrl>http://scisharpstack.org</PackageProjectUrl>
<Description>TensorFlow Datasets provides many public datasets as tf.data.Datasets.</Description>
<RepositoryUrl>https://github.com/SciSharp/TensorFlow.NET</RepositoryUrl>
<RepositoryType>git</RepositoryType>
<PackageTags>SciSharp, Dataset, TensorFlow</PackageTags>
<Copyright>Apache 2.0</Copyright>
</PropertyGroup>

</Project>

+ 74
- 0
test/TensorFlowNET.Examples/ImageProcessing/CIFAR10-CNN.cs View File

@@ -0,0 +1,74 @@
/*****************************************************************************
Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
******************************************************************************/

using System;
using System.Collections.Generic;
using System.Text;
using Tensorflow;
using TensorFlowDatasets;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples
{
/// <summary>
/// https://www.tensorflow.org/tutorials/images/deep_cnn
/// </summary>
public class CIFAR10_CNN : IExample
{
public bool Enabled { get; set; } = true;
public bool IsImportingGraph { get; set; } = false;

public string Name => "CIFAR-10 CNN";

public bool Run()
{
PrepareData();

return true;
}

public Graph BuildGraph()
{
throw new NotImplementedException();
}

public Graph ImportGraph()
{
throw new NotImplementedException();
}

public void Predict(Session sess)
{
throw new NotImplementedException();
}

public void PrepareData()
{
var tfds = new DatasetBuilder();
tfds.download_and_prepare();
}

public void Test(Session sess)
{
throw new NotImplementedException();
}

public void Train(Session sess)
{
throw new NotImplementedException();
}
}
}

+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionCNN.cs View File

@@ -21,7 +21,7 @@ using Tensorflow;
using Tensorflow.Hub;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples.ImageProcess
namespace TensorFlowNET.Examples
{
/// <summary>
/// Convolutional Neural Network classifier for Hand Written Digits


+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionNN.cs View File

@@ -20,7 +20,7 @@ using Tensorflow;
using Tensorflow.Hub;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples.ImageProcess
namespace TensorFlowNET.Examples
{
/// <summary>
/// Neural Network classifier for Hand Written Digits


+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/DigitRecognitionRNN.cs View File

@@ -20,7 +20,7 @@ using Tensorflow;
using Tensorflow.Hub;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples.ImageProcess
namespace TensorFlowNET.Examples
{
/// <summary>
/// Recurrent Neural Network for handwritten digits MNIST.


+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/ImageBackgroundRemoval.cs View File

@@ -4,7 +4,7 @@ using Tensorflow;
using TensorFlowNET.Examples.Utility;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples.ImageProcess
namespace TensorFlowNET.Examples
{
/// <summary>
/// This example removes the background from an input image.


+ 1
- 1
test/TensorFlowNET.Examples/ImageProcessing/RetrainImageClassifier.cs View File

@@ -25,7 +25,7 @@ using Tensorflow;
using TensorFlowNET.Examples.Utility;
using static Tensorflow.Python;

namespace TensorFlowNET.Examples.ImageProcess
namespace TensorFlowNET.Examples
{
/// <summary>
/// In this tutorial, we will reuse the feature extraction capabilities from powerful image classifiers trained on ImageNet


+ 1
- 0
test/TensorFlowNET.Examples/TensorFlowNET.Examples.csproj View File

@@ -16,6 +16,7 @@

<ItemGroup>
<ProjectReference Include="..\..\src\KerasNET.Core\Keras.Core.csproj" />
<ProjectReference Include="..\..\src\TensorFlowDatasets\TensorFlowDatasets.csproj" />
<ProjectReference Include="..\..\src\TensorFlowNET.Core\TensorFlowNET.Core.csproj" />
<ProjectReference Include="..\..\src\TensorFlowText\TensorFlowText.csproj" />
<ProjectReference Include="..\..\src\TensorFlowHub\TensorFlowHub.csproj" />


Loading…
Cancel
Save