Skip to content

Commit

Permalink
Fix issue #75 - Andrew Violette tracked down the bug with the MNIST l…
Browse files Browse the repository at this point in the history
…oader not working correctly - was copying byte sized blocks, not float-sized blocks
  • Loading branch information
migueldeicaza committed Nov 8, 2017
1 parent 9b32ca9 commit 25e35d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Learn/Datasets/MNIST.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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];
}
Expand Down

0 comments on commit 25e35d1

Please sign in to comment.