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

            NnGpuWinInterop.GetTrainingIteration(_nn, out interation);

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

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

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

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

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

            NnGpuWinInterop.GetLayerCount(_nn, out count);

            return(count);
        }
예제 #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);
        }
예제 #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);
        }
예제 #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);
        }
예제 #9
0
 public bool RunPerformanceTests()
 {
     return(NnGpuWinInterop.RunPerformanceTests(_nn));
 }
예제 #10
0
 public bool RunUnitTests()
 {
     return(NnGpuWinInterop.RunUnitTests(_nn));
 }
예제 #11
0
 public void GetLayerPerformanceData(int layerIndex, out uint averageTimeMs, out double averageBytes)
 {
     NnGpuWinInterop.GetLayerPerformanceData(_nn, layerIndex, out averageTimeMs, out averageBytes);
 }
예제 #12
0
 public void DisposeNetwork()
 {
     NnGpuWinInterop.DisposeNetwork(_nn);
 }