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.5 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
6 years ago
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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 STACK](https://github.com/SciSharp).
  9. ![tensors_flowing](docs/assets/tensors_flowing.gif)
  10. ### How to use
  11. Install TensorFlow.NET through NuGet.
  12. ```sh
  13. PM> Install-Package TensorFlow.NET
  14. ```
  15. If you are using Linux or Mac OS, please download the pre-compiled dll [here](tensorflow.so) and place it in the working folder. This is only need for Linux and Mac OS, and already packed into NuGet for Windows.
  16. Import tensorflow.net.
  17. ```cs
  18. using Tensorflow;
  19. ```
  20. Add two constants.
  21. ```cs
  22. // Create a Constant op
  23. var a = tf.constant(4.0f);
  24. var b = tf.constant(5.0f);
  25. var c = tf.add(a, b);
  26. using (var sess = tf.Session())
  27. {
  28. var o = sess.run(c);
  29. }
  30. ```
  31. Feed placeholder.
  32. ```cs
  33. // Create a placeholder op
  34. var a = tf.placeholder(tf.float32);
  35. var b = tf.placeholder(tf.float32);
  36. var c = tf.add(a, b);
  37. using(var sess = tf.Session())
  38. {
  39. var feed_dict = new Dictionary<Tensor, object>();
  40. feed_dict.Add(a, 3.0f);
  41. feed_dict.Add(b, 2.0f);
  42. var o = sess.run(c, feed_dict);
  43. }
  44. ```
  45. Read the docs & book [The Definitive Guide to Tensorflow.NET](https://tensorflownet.readthedocs.io/en/latest/FrontCover.html).
  46. More examples:
  47. * [Hello World](test/TensorFlowNET.Examples/HelloWorld.cs)
  48. * [Basic Operations](test/TensorFlowNET.Examples/BasicOperations.cs)
  49. * [Image Recognition](test/TensorFlowNET.Examples/ImageRecognition.cs)
  50. * [Linear Regression](test/TensorFlowNET.Examples/LinearRegression.cs)
  51. * [Text Classification with Movie Review](test/TensorFlowNET.Examples/TextClassificationWithMovieReviews.cs)
  52. Star me or raise issue on [Github](https://github.com/SciSharp/TensorFlow.NET) feel free.
  53. Scan QR code to join TIM group:
  54. ![SciSharp STACK](docs/TIM.jpg)

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