Skip to content

Google's TensorFlow binding for .NET Standard. Machine Learning works in .NET.

License

Notifications You must be signed in to change notification settings

wadereye/TensorFlow.NET

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

TensorFlow.NET

TensorFlow.NET provides .NET Standard binding for TensorFlow.

Join the chat at https://gitter.im/publiclab/publiclab Tensorflow.NET codecov NuGet Documentation Status

TensorFlow.NET is a member project of SciSharp stack.

tensors_flowing

How to use

Install TensorFlow.NET through NuGet.

PM> Install-Package TensorFlow.NET

If you are using Linux or Mac OS, please download the pre-compiled dll here and place it in the working folder. This is only need for Linux and Mac OS, and already packed into NuGet for Windows.

Import tensorflow.net.

using Tensorflow;

Add two constants.

// Create a Constant op
var a = tf.constant(4.0f);
var b = tf.constant(5.0f);
var c = tf.add(a, b);

using (var sess = tf.Session())
{
    var o = sess.run(c);
}

Feed placeholder.

// Create a placeholder op
var a = tf.placeholder(tf.float32);
var b = tf.placeholder(tf.float32);
var c = tf.add(a, b);

using(var sess = tf.Session())
{
    var feed_dict = new Dictionary<Tensor, object>();
    feed_dict.Add(a, 3.0f);
    feed_dict.Add(b, 2.0f);

    var o = sess.run(c, feed_dict);
}

Read the docs & book The Definitive Guide to Tensorflow.NET.

Star me or raise issue on Github feel free.

Scan QR code to join TIM group:

SciSharp STACK

About

Google's TensorFlow binding for .NET Standard. Machine Learning works in .NET.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C# 99.4%
  • Other 0.6%