Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created November 8, 2019 15:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdfarragher/5045457520a49f4f1599a75550378fe4 to your computer and use it in GitHub Desktop.
Save mdfarragher/5045457520a49f4f1599a75550378fe4 to your computer and use it in GitHub Desktop.
var maxEpochs = 10;
var batchSize = 64;
var loss = new double[maxEpochs];
var trainingError = new double[maxEpochs];
var testingError = new double[maxEpochs];
var batchCount = 0;
for (int epoch = 0; epoch < maxEpochs; epoch++)
{
// training and testing code goes here...
}
// show final results
var finalError = testingError[maxEpochs-1];
Console.WriteLine();
Console.WriteLine($"Final test error: {finalError:0.00}");
Console.WriteLine($"Final test accuracy: {1 - finalError:0.00}");
// plotting code goes here...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment