You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 2.0 kB

6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. # TensorFlow.NET
  2. TensorFlow.NET provides .NET Standard binding for [TensorFlow](https://www.tensorflow.org/).
  3. [![Join the chat at https://gitter.im/publiclab/publiclab](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/sci-sharp/community)
  4. [![Tensorflow.NET](https://ci.appveyor.com/api/projects/status/wx4td43v2d3f2xj6?svg=true)](https://ci.appveyor.com/project/Haiping-Chen/tensorflow-net)
  5. [![codecov](https://codecov.io/gh/SciSharp/NumSharp/branch/master/graph/badge.svg)](https://codecov.io/gh/SciSharp/NumSharp)
  6. [![NuGet](https://img.shields.io/nuget/dt/TensorFlow.NET.svg)](https://www.nuget.org/packages/TensorFlow.NET)
  7. [![Documentation Status](https://readthedocs.org/projects/tensorflownet/badge/?version=latest)](https://tensorflownet.readthedocs.io/en/latest/?badge=latest)
  8. TensorFlow.NET is a member project of [SciSharp](https://github.com/SciSharp) stack.
  9. ![tensors_flowing](docs/assets/tensors_flowing.gif)
  10. ### How to use
  11. Download the pre-compiled dll [here](tensorflow.so) and place it in the working folder.
  12. This is only need for Linux and Mac OS, and already packed for Windows.
  13. Install TensorFlow.NET through NuGet.
  14. ```sh
  15. PM> Install-Package TensorFlow.NET
  16. ```
  17. Import tensorflow.net.
  18. ```cs
  19. using Tensorflow;
  20. ```
  21. Add two constants.
  22. ```cs
  23. // Create a Constant op
  24. var a = tf.constant(4.0f);
  25. var b = tf.constant(5.0f);
  26. var c = tf.add(a, b);
  27. using (var sess = tf.Session())
  28. {
  29. var o = sess.run(c);
  30. }
  31. ```
  32. Feed placeholder.
  33. ```cs
  34. // Create a placeholder op
  35. var a = tf.placeholder(tf.float32);
  36. var b = tf.placeholder(tf.float32);
  37. var c = tf.add(a, b);
  38. using(var sess = tf.Session())
  39. {
  40. var feed_dict = new Dictionary<Tensor, object>();
  41. feed_dict.Add(a, 3.0f);
  42. feed_dict.Add(b, 2.0f);
  43. var o = sess.run(c, feed_dict);
  44. }
  45. ```
  46. Read the docs & book [The Definitive Guide to Tensorflow.NET](https://tensorflownet.readthedocs.io/en/latest/FrontCover.html).
  47. Star me or raise issue on [Github](https://github.com/SciSharp/TensorFlow.NET) feel free.

tensorflow框架的.NET版本,提供了丰富的特性和API,可以借此很方便地在.NET平台下搭建深度学习训练与推理流程。