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.

LogisticRegression.cs 762 B

6 years ago
123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Tensorflow;
  5. using TensorFlowNET.Examples.Utility;
  6. namespace TensorFlowNET.Examples
  7. {
  8. /// <summary>
  9. /// A logistic regression learning algorithm example using TensorFlow library.
  10. /// This example is using the MNIST database of handwritten digits
  11. /// https://github.com/aymericdamien/TensorFlow-Examples/blob/master/examples/2_BasicModels/logistic_regression.py
  12. /// </summary>
  13. public class LogisticRegression : Python, IExample
  14. {
  15. public void Run()
  16. {
  17. PrepareData();
  18. }
  19. private void PrepareData()
  20. {
  21. MnistDataSet.read_data_sets("logistic_regression", one_hot: true);
  22. }
  23. }
  24. }

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