本文整理汇总了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());
}