Skip to content

Instantly share code, notes, and snippets.

@mdfarragher
Created December 2, 2019 12:31
Show Gist options
  • Save mdfarragher/132e07b0e2ad6a288774bd2c79e2adff to your computer and use it in GitHub Desktop.
Save mdfarragher/132e07b0e2ad6a288774bd2c79e2adff 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