public class EmnistDataSetIterator extends org.nd4j.linalg.dataset.api.iterator.BaseDatasetIterator
| Modifier and Type | Class and Description |
|---|---|
static class |
EmnistDataSetIterator.Set
EMNIST dataset has multiple different subsets.
|
| Modifier and Type | Field and Description |
|---|---|
protected int |
batch |
protected EmnistDataSetIterator.Set |
dataSet |
protected int |
numExamples |
protected org.nd4j.linalg.dataset.api.DataSetPreProcessor |
preProcessor |
fetcher| Constructor and Description |
|---|
EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet,
int batch,
boolean train)
Create an EMNIST iterator with randomly shuffled data based on a random RNG seed
|
EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet,
int batch,
boolean binarize,
boolean train,
boolean shuffle,
long rngSeed)
Get the specified number of MNIST examples (test or train set), with optional shuffling and binarization.
|
EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet,
int batchSize,
boolean train,
long seed)
Create an EMNIST iterator with randomly shuffled data based on a specified RNG seed
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getLabels()
Get the labels as a List
|
static List<String> |
getLabels(EmnistDataSetIterator.Set dataSet)
Get the label assignments for the given set as a List
|
static char[] |
getLabelsArray(EmnistDataSetIterator.Set dataSet)
Get the label assignments for the given set as a character array.
|
char[] |
getLabelsArrays()
Get the labels as a character array
|
static boolean |
isBalanced(EmnistDataSetIterator.Set dataSet)
Are the labels balanced in the training set (that is: are the number of examples for each label equal?)
|
static int |
numExamplesTest(EmnistDataSetIterator.Set dataSet)
Get the number of test examples for the specified subset
|
static int |
numExamplesTrain(EmnistDataSetIterator.Set dataSet)
Get the number of training examples for the specified subset
|
static int |
numLabels(EmnistDataSetIterator.Set dataSet)
Get the number of labels for the specified subset
|
asyncSupported, batch, getPreProcessor, hasNext, inputColumns, next, next, remove, reset, resetSupported, setPreProcessor, totalOutcomesclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingprotected EmnistDataSetIterator.Set dataSet
protected int batch
protected int numExamples
protected org.nd4j.linalg.dataset.api.DataSetPreProcessor preProcessor
public EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet, int batch, boolean train) throws IOException
dataSet - Dataset (subset) to returnbatch - Batch sizetrain - If true: use training set. If false: use test setIOException - If an error occurs when loading/downloading the datasetpublic EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet, int batchSize, boolean train, long seed) throws IOException
dataSet - Dataset (subset) to returnbatchSize - Batch sizetrain - If true: use training set. If false: use test setseed - Random number generator seedIOExceptionpublic EmnistDataSetIterator(EmnistDataSetIterator.Set dataSet, int batch, boolean binarize, boolean train, boolean shuffle, long rngSeed) throws IOException
batch - Size of each minibatchbinarize - 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 examplesIOExceptionpublic static int numExamplesTrain(EmnistDataSetIterator.Set dataSet)
dataSet - Subset to getpublic static int numExamplesTest(EmnistDataSetIterator.Set dataSet)
dataSet - Subset to getpublic static int numLabels(EmnistDataSetIterator.Set dataSet)
dataSet - Subset to getpublic char[] getLabelsArrays()
public List<String> getLabels()
getLabels in interface org.nd4j.linalg.dataset.api.iterator.DataSetIteratorgetLabels in class org.nd4j.linalg.dataset.api.iterator.BaseDatasetIteratorpublic static char[] getLabelsArray(EmnistDataSetIterator.Set dataSet)
dataSet - DataSet to get the label assignment forpublic static List<String> getLabels(EmnistDataSetIterator.Set dataSet)
dataSet - DataSet to get the label assignment forpublic static boolean isBalanced(EmnistDataSetIterator.Set dataSet)
dataSet - Set to get balanced value forCopyright © 2021. All rights reserved.