GoMNIST icon indicating copy to clipboard operation
GoMNIST copied to clipboard

Sweeper.Next() doesn't increment sw.i

Open DanTulovsky opened this issue 8 years ago • 1 comments

I think you want:

// Next returns the next image and its label in the data set. // If the end is reached, present is set to false. func (sw *Sweeper) Next() (image RawImage, label Label, present bool) { if sw.i >= len(sw.set.Images) { return nil, 0, false } i, l, p := sw.set.Images[sw.i], sw.set.Labels[sw.i], true sw.i++ return i, l, p }

Otherwise it just keeps returning the first image.

DanTulovsky avatar Jul 29 '16 22:07 DanTulovsky

i think so also

huwenbo avatar Jul 16 '20 11:07 huwenbo