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.

ExamplesTest.cs 3.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. using Microsoft.VisualStudio.TestTools.UnitTesting;
  5. using Tensorflow;
  6. using TensorFlowNET.Examples;
  7. namespace TensorFlowNET.ExamplesTests
  8. {
  9. [TestClass]
  10. public class ExamplesTest
  11. {
  12. [TestMethod]
  13. public void BasicOperations()
  14. {
  15. tf.Graph().as_default();
  16. new BasicOperations() { Enabled = true }.Run();
  17. }
  18. [TestMethod]
  19. public void HelloWorld()
  20. {
  21. tf.Graph().as_default();
  22. new HelloWorld() { Enabled = true }.Run();
  23. }
  24. [TestMethod]
  25. public void ImageRecognition()
  26. {
  27. tf.Graph().as_default();
  28. new HelloWorld() { Enabled = true }.Run();
  29. }
  30. [Ignore]
  31. [TestMethod]
  32. public void InceptionArchGoogLeNet()
  33. {
  34. tf.Graph().as_default();
  35. new InceptionArchGoogLeNet() { Enabled = true }.Run();
  36. }
  37. [TestMethod]
  38. public void KMeansClustering()
  39. {
  40. tf.Graph().as_default();
  41. new KMeansClustering() { Enabled = true, IsImportingGraph = true, train_size = 500, validation_size = 100, test_size = 100, batch_size =100 }.Run();
  42. }
  43. [TestMethod]
  44. public void LinearRegression()
  45. {
  46. tf.Graph().as_default();
  47. new LinearRegression() { Enabled = true }.Run();
  48. }
  49. [TestMethod]
  50. public void LogisticRegression()
  51. {
  52. tf.Graph().as_default();
  53. new LogisticRegression() { Enabled = true, training_epochs=10, train_size = 500, validation_size = 100, test_size = 100 }.Run();
  54. }
  55. [Ignore]
  56. [TestMethod]
  57. public void NaiveBayesClassifier()
  58. {
  59. tf.Graph().as_default();
  60. new NaiveBayesClassifier() { Enabled = false }.Run();
  61. }
  62. [Ignore]
  63. [TestMethod]
  64. public void NamedEntityRecognition()
  65. {
  66. tf.Graph().as_default();
  67. new NamedEntityRecognition() { Enabled = true }.Run();
  68. }
  69. [TestMethod]
  70. public void NearestNeighbor()
  71. {
  72. tf.Graph().as_default();
  73. new NearestNeighbor() { Enabled = true, TrainSize = 500, ValidationSize = 100, TestSize = 100 }.Run();
  74. }
  75. [Ignore]
  76. [TestMethod]
  77. public void TextClassificationTrain()
  78. {
  79. tf.Graph().as_default();
  80. new TextClassificationTrain() { Enabled = true, DataLimit=100 }.Run();
  81. }
  82. [TestMethod]
  83. public void CnnTextClassificationTrain()
  84. {
  85. tf.Graph().as_default();
  86. new CnnTextClassification() { Enabled = true, IsImportingGraph = false }.Run();
  87. }
  88. [Ignore]
  89. [TestMethod]
  90. public void TextClassificationWithMovieReviews()
  91. {
  92. tf.Graph().as_default();
  93. new BinaryTextClassification() { Enabled = true }.Run();
  94. }
  95. [TestMethod]
  96. public void NeuralNetXor()
  97. {
  98. tf.Graph().as_default();
  99. Assert.IsTrue(new NeuralNetXor() { Enabled = true, IsImportingGraph = false }.Run());
  100. }
  101. [TestMethod]
  102. public void NeuralNetXor_ImportedGraph()
  103. {
  104. tf.Graph().as_default();
  105. Assert.IsTrue(new NeuralNetXor() { Enabled = true, IsImportingGraph = true }.Run());
  106. }
  107. [TestMethod]
  108. public void ObjectDetection()
  109. {
  110. tf.Graph().as_default();
  111. Assert.IsTrue(new ObjectDetection() { Enabled = true, IsImportingGraph = true }.Run());
  112. }
  113. }
  114. }