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.

DataSet.cs 527 B

6 years ago
1234567891011121314151617181920
  1. using NumSharp.Core;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Text;
  5. using Tensorflow;
  6. namespace TensorFlowNET.Examples.Utility
  7. {
  8. public class DataSet
  9. {
  10. private int _num_examples;
  11. public DataSet(NDArray images, NDArray labels, TF_DataType dtype, bool reshape)
  12. {
  13. _num_examples = images.shape[0];
  14. images = images.reshape(images.shape[0], images.shape[1] * images.shape[2]);
  15. images = np.multiply(images, 1.0f / 255.0f);
  16. }
  17. }
  18. }

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