use of org.deeplearning4j.datasets.iterator.AsyncDataSetIterator in project deeplearning4j by deeplearning4j.
the class ParameterServerParallelWrapper method fit.
public void fit(DataSetIterator source) {
if (!init)
init(source);
DataSetIterator iterator;
if (preFetchSize > 0 && source.asyncSupported())
iterator = new AsyncDataSetIterator(source, preFetchSize);
else
iterator = source;
for (int i = 0; i < numEpochs; i++) {
while (iterator.hasNext()) {
DataSet next = iterator.next();
addObject(next);
}
iterator.reset();
log.info(String.format("Completed epoch %d", i));
}
}
Aggregations