Skip to content

Commit 25e35d1

Browse files
committed
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
1 parent 9b32ca9 commit 25e35d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Learn/Datasets/MNIST.cs

+2-2
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ internal BatchReader (MnistImage [] source, byte [] labels, byte [,] oneHotLabel
6868

6969
int p = 0;
7070
for (int item = 0; item < batchSize; item++) {
71-
Buffer.BlockCopy (source [start+item].DataFloat, 0, imageData, p, 784);
72-
p += 784;
71+
Buffer.BlockCopy (source [start+item].DataFloat, 0, imageData, p, 784 * sizeof (float));
72+
p += 784 * sizeof (float);
7373
for (var j = 0; j < 10; j++)
7474
labelData [item, j] = oneHotLabels [item + start, j];
7575
}

0 commit comments

Comments
 (0)