public class BenchmarkDataSetIterator extends Object implements DataSetIterator
| Constructor and Description |
|---|
BenchmarkDataSetIterator(DataSet example,
int totalIterations) |
BenchmarkDataSetIterator(int[] featuresShape,
int numLabels,
int totalIterations) |
BenchmarkDataSetIterator(int[] featuresShape,
int numLabels,
int totalIterations,
int gridWidth,
int gridHeight)
Creates 2d (shape [minibatch, numLabels]) or 4d labels ([minibatch, numLabels, gridWidth, gridHeight]),
depending on value of gridWidth and gridHeight.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
asyncSupported() |
int |
batch() |
List<String> |
getLabels() |
DataSetPreProcessor |
getPreProcessor() |
boolean |
hasNext()
Returns
true if the iteration has more elements. |
int |
inputColumns() |
DataSet |
next()
Returns the next element in the iteration.
|
DataSet |
next(int i) |
void |
remove()
Removes from the underlying collection the last element returned
by this iterator (optional operation).
|
void |
reset() |
boolean |
resetSupported() |
void |
setPreProcessor(DataSetPreProcessor dataSetPreProcessor) |
int |
totalOutcomes() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitforEachRemainingpublic BenchmarkDataSetIterator(int[] featuresShape,
int numLabels,
int totalIterations)
featuresShape - Shape of the features data to randomly generatenumLabels - Number of label classes (for classification)totalIterations - Total number of iterations per epochpublic BenchmarkDataSetIterator(int[] featuresShape,
int numLabels,
int totalIterations,
int gridWidth,
int gridHeight)
featuresShape - Shape of the features data to randomly generatenumLabels - Number of label classes (for classification)totalIterations - Total number of iterationsgridWidth - If > 0, use to create 4d labelsgridHeight - If > 0, use to create 4d labelspublic BenchmarkDataSetIterator(DataSet example, int totalIterations)
example - DataSet to return on each call of next()totalIterations - Total number of iterationspublic DataSet next(int i)
next in interface DataSetIteratorpublic int inputColumns()
inputColumns in interface DataSetIteratorpublic int totalOutcomes()
totalOutcomes in interface DataSetIteratorpublic boolean resetSupported()
resetSupported in interface DataSetIteratorpublic boolean asyncSupported()
asyncSupported in interface DataSetIteratorpublic void reset()
reset in interface DataSetIteratorpublic int batch()
batch in interface DataSetIteratorpublic void setPreProcessor(DataSetPreProcessor dataSetPreProcessor)
setPreProcessor in interface DataSetIteratorpublic DataSetPreProcessor getPreProcessor()
getPreProcessor in interface DataSetIteratorpublic List<String> getLabels()
getLabels in interface DataSetIteratorpublic boolean hasNext()
true if the iteration has more elements.
(In other words, returns true if next(int) would
return an element rather than throwing an exception.)public DataSet next()
public void remove()
next(int). The behavior of an iterator
is unspecified if the underlying collection is modified while the
iteration is in progress in any way other than by calling this
method.remove in interface Iterator<DataSet>UnsupportedOperationException - if the remove
operation is not supported by this iteratorIllegalStateException - if the next method has not
yet been called, or the remove method has already
been called after the last call to the next
methodCopyright © 2021. All rights reserved.