public void TrainIteration() { if (!_pause) { _trainingComplete = NnGpuWinInterop.TrainNetworkInteration(_nn); } }
public int GetTrainingIteration() { int interation = 0; NnGpuWinInterop.GetTrainingIteration(_nn, out interation); return(interation); }
public NnGpuLayerDataGroup GetLayerData(int layerIndex) { NnGpuLayerDataGroup layerDataGroup; NnGpuWinInterop.GetLayerData(_nn, layerIndex, out layerDataGroup); return(layerDataGroup); }
public int getLayerType(int layerIndex) { int type = 0; NnGpuWinInterop.GetLayerType(_nn, layerIndex, out type); return(type); }
public int GetLayerCount() { int count = 0; NnGpuWinInterop.GetLayerCount(_nn, out count); return(count); }
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); }
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); }
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); }
public bool RunPerformanceTests() { return(NnGpuWinInterop.RunPerformanceTests(_nn)); }
public bool RunUnitTests() { return(NnGpuWinInterop.RunUnitTests(_nn)); }
public void GetLayerPerformanceData(int layerIndex, out uint averageTimeMs, out double averageBytes) { NnGpuWinInterop.GetLayerPerformanceData(_nn, layerIndex, out averageTimeMs, out averageBytes); }
public void DisposeNetwork() { NnGpuWinInterop.DisposeNetwork(_nn); }