本文整理匯總了Java中org.datavec.api.io.converters.SelfWritableConverter類的典型用法代碼示例。如果您正苦於以下問題:Java SelfWritableConverter類的具體用法?Java SelfWritableConverter怎麽用?Java SelfWritableConverter使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SelfWritableConverter類屬於org.datavec.api.io.converters包,在下文中一共展示了SelfWritableConverter類的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: processBatchIfRequired
import org.datavec.api.io.converters.SelfWritableConverter; //導入依賴的package包/類
private void processBatchIfRequired(List<List<Writable>> list, boolean finalRecord) throws Exception {
if (list.isEmpty())
return;
if (list.size() < batchSize && !finalRecord)
return;
RecordReader rr = new CollectionRecordReader(list);
RecordReaderDataSetIterator iter = new RecordReaderDataSetIterator(rr, new SelfWritableConverter(), batchSize,
labelIndex, numPossibleLabels, regression);
DataSet ds = iter.next();
String filename = "dataset_" + uid + "_" + (outputCount++) + ".bin";
URI uri = new URI(outputDir.getPath() + "/" + filename);
FileSystem file = FileSystem.get(uri, conf);
try (FSDataOutputStream out = file.create(new Path(uri))) {
ds.save(out);
}
list.clear();
}
示例2: Pan15DataSetIterator
import org.datavec.api.io.converters.SelfWritableConverter; //導入依賴的package包/類
public Pan15DataSetIterator(RecordReader recordReader, Language language, Model inputModel) {
this(recordReader, new SelfWritableConverter(), Config.BATCH_SIZE, Config.IDX_FROM, Config.IDX_TO, -1, -1,
Config.REGRESSION, language, inputModel);
}
示例3: RecordReaderDataSetIterator
import org.datavec.api.io.converters.SelfWritableConverter; //導入依賴的package包/類
public RecordReaderDataSetIterator(RecordReader recordReader, int batchSize) {
this(recordReader, new SelfWritableConverter(), batchSize, -1,
recordReader.getLabels() == null ? -1 : recordReader.getLabels().size());
}