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.

CIFAR10-CNN.cs 2.1 kB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /*****************************************************************************
  2. Copyright 2018 The TensorFlow.NET Authors. All Rights Reserved.
  3. Licensed under the Apache License, Version 2.0 (the "License");
  4. you may not use this file except in compliance with the License.
  5. You may obtain a copy of the License at
  6. http://www.apache.org/licenses/LICENSE-2.0
  7. Unless required by applicable law or agreed to in writing, software
  8. distributed under the License is distributed on an "AS IS" BASIS,
  9. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  10. See the License for the specific language governing permissions and
  11. limitations under the License.
  12. ******************************************************************************/
  13. using System;
  14. using System.Collections.Generic;
  15. using System.Text;
  16. using Tensorflow;
  17. using TensorFlowDatasets;
  18. using static Tensorflow.Python;
  19. namespace TensorFlowNET.Examples
  20. {
  21. /// <summary>
  22. /// https://www.tensorflow.org/tutorials/images/deep_cnn
  23. /// </summary>
  24. public class CIFAR10_CNN : IExample
  25. {
  26. public bool Enabled { get; set; } = true;
  27. public bool IsImportingGraph { get; set; } = false;
  28. public string Name => "CIFAR-10 CNN";
  29. public bool Run()
  30. {
  31. PrepareData();
  32. return true;
  33. }
  34. public Graph BuildGraph()
  35. {
  36. throw new NotImplementedException();
  37. }
  38. public Graph ImportGraph()
  39. {
  40. throw new NotImplementedException();
  41. }
  42. public void Predict(Session sess)
  43. {
  44. throw new NotImplementedException();
  45. }
  46. public void PrepareData()
  47. {
  48. var tfds = new DatasetBuilder();
  49. tfds.download_and_prepare();
  50. }
  51. public void Test(Session sess)
  52. {
  53. throw new NotImplementedException();
  54. }
  55. public void Train(Session sess)
  56. {
  57. throw new NotImplementedException();
  58. }
  59. }
  60. }