Class MnistDataSetIterator
- java.lang.Object
-
- org.nd4j.linalg.dataset.api.iterator.BaseDatasetIterator
-
- org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator
-
- All Implemented Interfaces:
Serializable
,Iterator<org.nd4j.linalg.dataset.DataSet>
,org.nd4j.linalg.dataset.api.iterator.DataSetIterator
public class MnistDataSetIterator extends org.nd4j.linalg.dataset.api.iterator.BaseDatasetIterator
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description MnistDataSetIterator(int batchSize, boolean train, int seed)
Constructor to get the full MNIST data set (either test or train sets) without binarization (i.e., just normalization into range of 0 to 1), with shuffling based on a random seed.MnistDataSetIterator(int batch, int numExamples)
MnistDataSetIterator(int batch, int numExamples, boolean binarize)
Get the specified number of examples for the MNIST training data set.MnistDataSetIterator(int batch, int numExamples, boolean binarize, boolean train, boolean shuffle, long rngSeed)
Get the specified number of MNIST examples (test or train set), with optional shuffling and binarization.MnistDataSetIterator(int batch, int numExamples, boolean binarize, boolean train, boolean shuffle, long rngSeed, File topLevelDir)
Get the specified number of MNIST examples (test or train set), with optional shuffling and binarization.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
-
Methods inherited from class org.nd4j.linalg.dataset.api.iterator.BaseDatasetIterator
asyncSupported, batch, getLabels, getPreProcessor, hasNext, inputColumns, next, next, remove, reset, resetSupported, setPreProcessor, setTopLevelDir, topLevelDir, totalOutcomes
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface java.util.Iterator
forEachRemaining
-
-
-
-
Constructor Detail
-
MnistDataSetIterator
public MnistDataSetIterator(int batch, int numExamples) throws IOException
- Throws:
IOException
-
MnistDataSetIterator
public MnistDataSetIterator(int batch, int numExamples, boolean binarize) throws IOException
Get the specified number of examples for the MNIST training data set.- Parameters:
batch
- the batch size of the examplesnumExamples
- the overall number of examplesbinarize
- whether to binarize mnist or not- Throws:
IOException
-
MnistDataSetIterator
public MnistDataSetIterator(int batchSize, boolean train, int seed) throws IOException
Constructor to get the full MNIST data set (either test or train sets) without binarization (i.e., just normalization into range of 0 to 1), with shuffling based on a random seed.- Parameters:
batchSize
-train
-- Throws:
IOException
-
MnistDataSetIterator
public MnistDataSetIterator(int batch, int numExamples, boolean binarize, boolean train, boolean shuffle, long rngSeed) throws IOException
Get the specified number of MNIST examples (test or train set), with optional shuffling and binarization.- Parameters:
batch
- Size of each patchnumExamples
- total number of examples to loadbinarize
- whether to binarize the data or not (if false: normalize in range 0 to 1)train
- Train vs. test setshuffle
- whether to shuffle the examplesrngSeed
- random number generator seed to use when shuffling examples- Throws:
IOException
-
MnistDataSetIterator
public MnistDataSetIterator(int batch, int numExamples, boolean binarize, boolean train, boolean shuffle, long rngSeed, File topLevelDir) throws IOException
Get the specified number of MNIST examples (test or train set), with optional shuffling and binarization.- Parameters:
batch
- Size of each patchnumExamples
- total number of examples to loadbinarize
- whether to binarize the data or not (if false: normalize in range 0 to 1)train
- Train vs. test setshuffle
- whether to shuffle the examplesrngSeed
- random number generator seed to use when shuffling examples- Throws:
IOException
-
-