@@ -4,7 +4,7 @@ using System.Text; | |||||
namespace Tensorflow | namespace Tensorflow | ||||
{ | { | ||||
public partial class tf | |||||
public static partial class tf | |||||
{ | { | ||||
public static Tensor read_file(string filename, string name = null) => gen_io_ops.read_file(filename, name); | public static Tensor read_file(string filename, string name = null) => gen_io_ops.read_file(filename, name); | ||||
@@ -0,0 +1,10 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Data | |||||
{ | |||||
public class DatasetV1 : DatasetV2 | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,13 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Data | |||||
{ | |||||
/// <summary> | |||||
/// Wraps a V2 `Dataset` object in the `tf.compat.v1.data.Dataset` API. | |||||
/// </summary> | |||||
public class DatasetV1Adapter : DatasetV1 | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,19 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Data | |||||
{ | |||||
/// <summary> | |||||
/// Represents a potentially large set of elements. | |||||
/// | |||||
/// A `Dataset` can be used to represent an input pipeline as a | |||||
/// collection of elements (nested structures of tensors) and a "logical | |||||
/// plan" of transformations that act on those elements. | |||||
/// | |||||
/// tensorflow\python\data\ops\dataset_ops.py | |||||
/// </summary> | |||||
public class DatasetV2 | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,38 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
using Tensorflow.Data; | |||||
namespace Tensorflow.Estimator | |||||
{ | |||||
/// <summary> | |||||
/// Estimator class to train and evaluate TensorFlow models. | |||||
/// <see cref="tensorflow_estimator\python\estimator\estimator.py"/> | |||||
/// </summary> | |||||
public class EstimatorV2 : IEstimator | |||||
{ | |||||
public EstimatorV2(string model_dir = null) | |||||
{ | |||||
} | |||||
/// <summary> | |||||
/// Calls the input function. | |||||
/// </summary> | |||||
/// <param name="mode"></param> | |||||
public void call_input_fn(string mode = null) | |||||
{ | |||||
} | |||||
public void train_model_default(Func<string, string, HyperParams, bool, DatasetV1Adapter> input_fn) | |||||
{ | |||||
} | |||||
public void get_features_and_labels_from_input_fn() | |||||
{ | |||||
} | |||||
} | |||||
} |
@@ -0,0 +1,27 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Estimator | |||||
{ | |||||
public class HyperParams | |||||
{ | |||||
public string data_dir { get; set; } | |||||
public string result_dir { get; set; } | |||||
public string model_dir { get; set; } | |||||
public string eval_dir { get; set; } | |||||
public int dim { get; set; } = 300; | |||||
public float dropout { get; set; } = 0.5f; | |||||
public int num_oov_buckets { get; set; } = 1; | |||||
public int epochs { get; set; } = 25; | |||||
public int batch_size { get; set; } = 20; | |||||
public int buffer { get; set; } = 15000; | |||||
public int lstm_size { get; set; } = 100; | |||||
public string words { get; set; } | |||||
public string chars { get; set; } | |||||
public string tags { get; set; } | |||||
public string glove { get; set; } | |||||
} | |||||
} |
@@ -0,0 +1,11 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Estimator | |||||
{ | |||||
public interface IEstimator | |||||
{ | |||||
} | |||||
} |
@@ -0,0 +1,6 @@ | |||||
### TensorFlow Estimator | |||||
TensorFlow Estimator is a high-level TensorFlow API that greatly simplifies machine learning programming. Estimators encapsulate training, evaluation, prediction, and exporting for your model. | |||||
Guide: <https://www.tensorflow.org/guide/estimators> | |||||
@@ -0,0 +1,19 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
namespace Tensorflow.Estimator | |||||
{ | |||||
/// <summary> | |||||
/// The executor to run `Estimator` training and evaluation. | |||||
/// <see cref="tensorflow_estimator\python\estimator\training.py"/> | |||||
/// </summary> | |||||
public class TrainingExecutor : Python | |||||
{ | |||||
private IEstimator _estimator; | |||||
public TrainingExecutor(IEstimator estimator) | |||||
{ | |||||
_estimator = estimator; | |||||
} | |||||
} | |||||
} |
@@ -13,7 +13,7 @@ namespace TensorFlowNET.Examples | |||||
/// </summary> | /// </summary> | ||||
public class BiLstmCrfNer : IExample | public class BiLstmCrfNer : IExample | ||||
{ | { | ||||
public int Priority => 13; | |||||
public int Priority => 101; | |||||
public bool Enabled { get; set; } = true; | public bool Enabled { get; set; } = true; | ||||
public bool ImportGraph { get; set; } = false; | public bool ImportGraph { get; set; } = false; | ||||
@@ -24,7 +24,7 @@ namespace TensorFlowNET.Examples | |||||
public bool Run() | public bool Run() | ||||
{ | { | ||||
PrepareData(); | PrepareData(); | ||||
return true; | |||||
return false; | |||||
} | } | ||||
public void PrepareData() | public void PrepareData() | ||||
@@ -0,0 +1,34 @@ | |||||
using System; | |||||
using System.Collections.Generic; | |||||
using System.Text; | |||||
using Tensorflow; | |||||
namespace TensorFlowNET.Examples | |||||
{ | |||||
/// <summary> | |||||
/// The CRF module implements a linear-chain CRF layer for learning to predict tag sequences. | |||||
/// This variant of the CRF is factored into unary potentials for every element | |||||
/// in the sequence and binary potentials for every transition between output tags. | |||||
/// | |||||
/// tensorflow\contrib\crf\python\ops\crf.py | |||||
/// </summary> | |||||
public class CRF : Python, IExample | |||||
{ | |||||
public int Priority => 13; | |||||
public bool Enabled { get; set; } = true; | |||||
public bool ImportGraph { get; set; } = false; | |||||
public string Name => "CRF"; | |||||
public bool Run() | |||||
{ | |||||
return true; | |||||
} | |||||
public void PrepareData() | |||||
{ | |||||
} | |||||
} | |||||
} |