public class CifarDataSetIterator extends RecordReaderDataSetIterator
RecordReaderDataSetIterator.Builder
Modifier and Type | Field and Description |
---|---|
protected static int |
CHANNELS |
protected int |
exampleCount |
protected static int |
HEIGHT |
protected ImageTransform |
imageTransform |
protected CifarLoader |
loader |
protected int |
numExamples |
protected boolean |
overshot |
protected boolean |
train |
protected boolean |
useSpecialPreProcessCifar |
protected static int |
WIDTH |
batchNum, batchSize, converter, labelIndex, labelIndexTo, last, maxNumBatches, numPossibleLabels, preProcessor, recordReader, regression, sequenceIter, useCurrent
Constructor and Description |
---|
CifarDataSetIterator(int batchSize,
int numExamples)
Loads images with given batchSize & numExamples returned by the generator.
|
CifarDataSetIterator(int batchSize,
int[] imgDim)
Loads images with given batchSize & imgDim returned by the generator.
|
CifarDataSetIterator(int batchSize,
int numExamples,
boolean train)
Loads images with given batchSize, numExamples, & version returned by the generator.
|
CifarDataSetIterator(int batchSize,
int numExamples,
int[] imgDim)
Loads images with given batchSize, numExamples, & imgDim returned by the generator.
|
CifarDataSetIterator(int batchSize,
int numExamples,
int[] imgDim,
boolean train)
Loads images with given batchSize, numExamples, imgDim & version returned by the generator.
|
CifarDataSetIterator(int batchSize,
int numExamples,
int[] imgDim,
boolean useSpecialPreProcessCifar,
boolean train)
Loads images with given batchSize, numExamples, imgDim & version returned by the generator.
|
CifarDataSetIterator(int batchSize,
int numExamples,
int[] imgDim,
int numPossibleLables,
ImageTransform imageTransform,
boolean useSpecialPreProcessCifar,
boolean train)
Create Cifar data specific iterator
|
CifarDataSetIterator(int batchSize,
int numExamples,
int[] imgDim,
int numPossibleLables,
ImageTransform imageTransform,
boolean useSpecialPreProcessCifar,
boolean train,
long rngSeed,
boolean randomize)
Create Cifar data specific iterator
|
Modifier and Type | Method and Description |
---|---|
boolean |
asyncSupported()
Does this DataSetIterator support asynchronous prefetching of multiple DataSet objects?
Most DataSetIterators do, but in some cases it may not make sense to wrap this iterator in an
iterator that does asynchronous prefetching.
|
java.util.List<java.lang.String> |
getLabels()
Get dataset iterator class labels, if any.
|
boolean |
hasNext() |
DataSet |
next(int batchSize)
Like the standard next method but allows a
customizable number of examples returned
|
void |
reset()
Resets the iterator back to the beginning
|
boolean |
resetSupported()
Is resetting supported by this DataSetIterator? Many DataSetIterators do support resetting,
but some don't
|
batch, inputColumns, loadFromMetaData, loadFromMetaData, next, remove, setCollectMetaData, setPreProcessor, totalOutcomes
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getPreProcessor
protected static final int HEIGHT
protected static final int WIDTH
protected static final int CHANNELS
protected final CifarLoader loader
protected final int numExamples
protected final boolean useSpecialPreProcessCifar
protected final boolean train
protected final ImageTransform imageTransform
protected int exampleCount
protected boolean overshot
public CifarDataSetIterator(int batchSize, int numExamples)
public CifarDataSetIterator(int batchSize, int numExamples, boolean train)
public CifarDataSetIterator(int batchSize, int[] imgDim)
public CifarDataSetIterator(int batchSize, int numExamples, int[] imgDim)
public CifarDataSetIterator(int batchSize, int numExamples, int[] imgDim, boolean train)
public CifarDataSetIterator(int batchSize, int numExamples, int[] imgDim, boolean useSpecialPreProcessCifar, boolean train)
public CifarDataSetIterator(int batchSize, int numExamples, int[] imgDim, int numPossibleLables, ImageTransform imageTransform, boolean useSpecialPreProcessCifar, boolean train)
batchSize
- the batch size of the examplesimgDim
- an array of height, width and channelsnumExamples
- the overall number of examplesimageTransform
- the transformation to apply to the imagesuseSpecialPreProcessCifar
- use Zagoruyko's preprocess for Cifartrain
- true if use training set and false for testpublic CifarDataSetIterator(int batchSize, int numExamples, int[] imgDim, int numPossibleLables, ImageTransform imageTransform, boolean useSpecialPreProcessCifar, boolean train, long rngSeed, boolean randomize)
batchSize
- the batch size of the examplesimgDim
- an array of height, width and channelsnumExamples
- the overall number of examplesimageTransform
- the transformation to apply to the imagesuseSpecialPreProcessCifar
- use Zagoruyko's preprocess for Cifartrain
- true if use training set and false for testrngSeed
- Seed for RNG repeatabilityrandomize
- If true: randomize the iteration order of the imagespublic DataSet next(int batchSize)
DataSetIterator
next
in interface DataSetIterator
next
in class RecordReaderDataSetIterator
batchSize
- the number of examplespublic boolean hasNext()
hasNext
in interface java.util.Iterator<DataSet>
hasNext
in class RecordReaderDataSetIterator
public void reset()
DataSetIterator
reset
in interface DataSetIterator
reset
in class RecordReaderDataSetIterator
public boolean resetSupported()
DataSetIterator
resetSupported
in interface DataSetIterator
resetSupported
in class RecordReaderDataSetIterator
public java.util.List<java.lang.String> getLabels()
DataSetIterator
getLabels
in interface DataSetIterator
getLabels
in class RecordReaderDataSetIterator
public boolean asyncSupported()
DataSetIterator
asyncSupported
in interface DataSetIterator
asyncSupported
in class RecordReaderDataSetIterator