Example #1
0
        public MainWindow()
        {
            InitializeComponent();

            MnistDataUnmanaged unmanagedData = new MnistDataUnmanaged();
            getTrainingData(unmanagedData);

            _mnistData = new MnistDataManaged(unmanagedData);
            freeData(unmanagedData);

            ShowImage(0);
        }
Example #2
0
        public MnistDataManaged(MnistDataUnmanaged unmanaged)
        {
            num_of_images = unmanaged.num_of_images;
            num_rows = unmanaged.num_rows;
            num_cols = unmanaged.num_cols;

            int total_pixels = num_of_images * num_rows * num_cols;
            pixels = new byte[total_pixels];
            Marshal.Copy(unmanaged.pixels, pixels, 0, total_pixels);

            lables = new byte[unmanaged.num_of_images];
            Marshal.Copy(unmanaged.lables, lables, 0, unmanaged.num_of_images);
        }
Example #3
0
 static extern int getTrainingData(MnistDataUnmanaged data);
Example #4
0
 static extern int freeData(MnistDataUnmanaged data);