Exemple #1
0
 public void TrainIteration()
 {
     if (!_pause)
     {
         _trainingComplete = NnGpuWinInterop.TrainNetworkInteration(_nn);
     }
 }
Exemple #2
0
        public int GetTrainingIteration()
        {
            int interation = 0;

            NnGpuWinInterop.GetTrainingIteration(_nn, out interation);

            return(interation);
        }
Exemple #3
0
        public NnGpuLayerDataGroup GetLayerData(int layerIndex)
        {
            NnGpuLayerDataGroup layerDataGroup;

            NnGpuWinInterop.GetLayerData(_nn, layerIndex, out layerDataGroup);

            return(layerDataGroup);
        }
Exemple #4
0
        public int getLayerType(int layerIndex)
        {
            int type = 0;

            NnGpuWinInterop.GetLayerType(_nn, layerIndex, out type);

            return(type);
        }
Exemple #5
0
        public int GetLayerCount()
        {
            int count = 0;

            NnGpuWinInterop.GetLayerCount(_nn, out count);

            return(count);
        }
Exemple #6
0
        public void InitializeTesting()
        {
            _testResults        = new List <NNGpuTestResult>();
            _correctPredictions = 0;

            byte[] imageData = LoadAndDecompressFile("data\\t10k-images-idx3-ubyte.gz");
            byte[] labelData = LoadAndDecompressFile("data\\t10k-labels-idx1-ubyte.gz");

            NnGpuWinInterop.InitializeTesting(_nn, imageData, imageData.Length, labelData, labelData.Length);
        }
Exemple #7
0
        public NNGpuTestResult TestIteration()
        {
            if (!_pause)
            {
                NNGpuTestResult result;
                _testingComplete = NnGpuWinInterop.TestNetworkInteration(_nn, out result);

                _testResults.Add(result);

                if (result.expected == result.predicted)
                {
                    _correctPredictions++;
                }

                return(result);
            }

            return(null);
        }
Exemple #8
0
        public void InitializeNetwork()
        {
            byte[] imageData = LoadAndDecompressFile("data\\train-images-idx3-ubyte.gz");
            byte[] labelData = LoadAndDecompressFile("data\\train-labels-idx1-ubyte.gz");

            _nn = NnGpuWinInterop.Initialize();
            NnGpuWinInterop.InitializeNetwork(_nn);
            NnGpuWinInterop.AddInputLayer(_nn, 28, 28, 1);
            NnGpuWinInterop.AddConvLayer(_nn, 3, 3, 48, 1, 1);
            NnGpuWinInterop.AddReluLayer(_nn);
            NnGpuWinInterop.AddPoolLayer(_nn, 2, 2);
            NnGpuWinInterop.AddConvLayer(_nn, 3, 3, 48, 1, 1);
            NnGpuWinInterop.AddReluLayer(_nn);
            NnGpuWinInterop.AddPoolLayer(_nn, 2, 2);
            NnGpuWinInterop.AddFullyConnected(_nn, 10);
            NnGpuWinInterop.AddSoftmax(_nn, 10);
            NnGpuWinInterop.AddOutput(_nn, 10);

            NnGpuWinInterop.InitializeTraining(_nn, imageData, imageData.Length, labelData, labelData.Length, 2);
        }
Exemple #9
0
 public bool RunPerformanceTests()
 {
     return(NnGpuWinInterop.RunPerformanceTests(_nn));
 }
Exemple #10
0
 public bool RunUnitTests()
 {
     return(NnGpuWinInterop.RunUnitTests(_nn));
 }
Exemple #11
0
 public void GetLayerPerformanceData(int layerIndex, out uint averageTimeMs, out double averageBytes)
 {
     NnGpuWinInterop.GetLayerPerformanceData(_nn, layerIndex, out averageTimeMs, out averageBytes);
 }
Exemple #12
0
 public void DisposeNetwork()
 {
     NnGpuWinInterop.DisposeNetwork(_nn);
 }