Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created December 3, 2019 13:29
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/05513fbd95e67408731a89d670510fb8 to your computer and use it in GitHub Desktop.
Save mdfarragher/05513fbd95e67408731a89d670510fb8 to your computer and use it in GitHub Desktop.
var maxEpochs = 10;
var batchSize = 128;
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