From 25e35d1bc06878c97bb5b31d7a9b0e08036f47a5 Mon Sep 17 00:00:00 2001 From: Miguel de Icaza Date: Wed, 8 Nov 2017 10:31:08 -0500 Subject: [PATCH] Fix issue #75 - Andrew Violette tracked down the bug with the MNIST loader not working correctly - was copying byte sized blocks, not float-sized blocks --- Learn/Datasets/MNIST.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Learn/Datasets/MNIST.cs b/Learn/Datasets/MNIST.cs index a7aafcbd..b31fa3f2 100644 --- a/Learn/Datasets/MNIST.cs +++ b/Learn/Datasets/MNIST.cs @@ -68,8 +68,8 @@ internal BatchReader (MnistImage [] source, byte [] labels, byte [,] oneHotLabel int p = 0; for (int item = 0; item < batchSize; item++) { - Buffer.BlockCopy (source [start+item].DataFloat, 0, imageData, p, 784); - p += 784; + Buffer.BlockCopy (source [start+item].DataFloat, 0, imageData, p, 784 * sizeof (float)); + p += 784 * sizeof (float); for (var j = 0; j < 10; j++) labelData [item, j] = oneHotLabels [item + start, j]; }