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/6341d7f48081988feb2cc10455d7309f to your computer and use it in GitHub Desktop.
Save mdfarragher/6341d7f48081988feb2cc10455d7309f to your computer and use it in GitHub Desktop.
// test one epoch on batches
testingError[epoch] = 0.0;
batchCount = 0;
testing_data.Batch(batchSize, (data, begin, end) =>
{
// get the current batch for testing
var featureBatch = features.GetBatch(testing_data, begin, end);
var labelBatch = labels.GetBatch(testing_labels, begin, end);
// test the network on the batch
testingError[epoch] += evaluator.TestBatch(
new[] {
(features, featureBatch),
(labels, labelBatch)
}
);
batchCount++;
});
testingError[epoch] /= batchCount;
Console.WriteLine($"{testingError[epoch]:F3}");
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment