public class MNISTRecordReader extends Object implements org.canova.api.records.reader.RecordReader
| Modifier and Type | Field and Description |
|---|---|
protected org.nd4j.linalg.dataset.DataSet |
curr |
protected org.canova.api.split.InputSplit |
inputSplit |
static int |
NUM_EXAMPLES |
static String |
trainingFileLabelsFilename_unzipped |
static String |
trainingFilesFilename_unzipped |
| Constructor and Description |
|---|
MNISTRecordReader() |
| Modifier and Type | Method and Description |
|---|---|
void |
close() |
protected org.nd4j.linalg.api.ndarray.INDArray |
createInputMatrix(int numRows)
Creates a feature vector
|
protected org.nd4j.linalg.api.ndarray.INDArray |
createOutputMatrix(int numRows) |
protected org.nd4j.linalg.api.ndarray.INDArray |
createOutputVector(int outcomeLabel)
Creates an output label matrix
|
boolean |
fetchNext()
Based on logic from fetcher:
https://github.com/deeplearning4j/deeplearning4j/blob/master/deeplearning4j-core/src/main/java/org/deeplearning4j/datasets/fetchers/MnistDataFetcher.java
The cursor logic here is broken.
|
org.canova.api.conf.Configuration |
getConf() |
List<String> |
getLabels() |
boolean |
hasNext() |
void |
initialize(org.canova.api.conf.Configuration conf,
org.canova.api.split.InputSplit split) |
void |
initialize(org.canova.api.split.InputSplit split) |
protected void |
initializeCurrFromList(List<org.nd4j.linalg.dataset.DataSet> examples)
Initializes this data transform fetcher from the passed in datasets
|
Collection<org.canova.api.writable.Writable> |
next()
Basic logic:
1.
|
Collection<org.canova.api.writable.Writable> |
record(URI uri,
DataInputStream dataInputStream) |
void |
reset() |
void |
setConf(org.canova.api.conf.Configuration conf) |
public static final int NUM_EXAMPLES
protected org.nd4j.linalg.dataset.DataSet curr
public static final String trainingFilesFilename_unzipped
public static final String trainingFileLabelsFilename_unzipped
protected org.canova.api.split.InputSplit inputSplit
public MNISTRecordReader()
throws IOException
IOExceptionpublic void initialize(org.canova.api.split.InputSplit split)
throws IOException,
InterruptedException
initialize in interface org.canova.api.records.reader.RecordReaderIOExceptionInterruptedExceptionpublic void initialize(org.canova.api.conf.Configuration conf,
org.canova.api.split.InputSplit split)
throws IOException,
InterruptedException
initialize in interface org.canova.api.records.reader.RecordReaderIOExceptionInterruptedExceptionpublic Collection<org.canova.api.writable.Writable> next()
next in interface org.canova.api.records.reader.RecordReaderpublic boolean hasNext()
hasNext in interface org.canova.api.records.reader.RecordReaderpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void setConf(org.canova.api.conf.Configuration conf)
setConf in interface org.canova.api.conf.Configurablepublic org.canova.api.conf.Configuration getConf()
getConf in interface org.canova.api.conf.Configurablepublic boolean fetchNext()
protected org.nd4j.linalg.api.ndarray.INDArray createOutputVector(int outcomeLabel)
outcomeLabel - the outcome label to useprotected org.nd4j.linalg.api.ndarray.INDArray createInputMatrix(int numRows)
numRows - the number of examplesprotected org.nd4j.linalg.api.ndarray.INDArray createOutputMatrix(int numRows)
protected void initializeCurrFromList(List<org.nd4j.linalg.dataset.DataSet> examples)
examples - the examples to usepublic List<String> getLabels()
getLabels in interface org.canova.api.records.reader.RecordReaderpublic void reset()
reset in interface org.canova.api.records.reader.RecordReaderpublic Collection<org.canova.api.writable.Writable> record(URI uri, DataInputStream dataInputStream) throws IOException
record in interface org.canova.api.records.reader.RecordReaderIOExceptionCopyright © 2016. All rights reserved.