当前位置: 首页>>代码示例>>Java>>正文


Java RecordMetaData.getURI方法代码示例

本文整理汇总了Java中org.datavec.api.records.metadata.RecordMetaData.getURI方法的典型用法代码示例。如果您正苦于以下问题:Java RecordMetaData.getURI方法的具体用法?Java RecordMetaData.getURI怎么用?Java RecordMetaData.getURI使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在org.datavec.api.records.metadata.RecordMetaData的用法示例。


在下文中一共展示了RecordMetaData.getURI方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {

    List<Record> out = new ArrayList<>();
    for (RecordMetaData metaData : recordMetaDatas) {
        URI uri = metaData.getURI();

        String fileAsString;
        try {
            fileAsString = FileUtils.readFileToString(new File(uri.toURL().getFile()));
        } catch (IOException e) {
            throw new RuntimeException("Error reading URI file", e);
        }

        List<Writable> writables = readValues(uri, fileAsString);
        out.add(new org.datavec.api.records.impl.Record(writables, metaData));
    }

    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:21,代码来源:JacksonRecordReader.java

示例2: loadFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {
    List<Record> out = new ArrayList<>();
    for (RecordMetaData meta : recordMetaDatas) {
        URI uri = meta.getURI();
        File f = new File(uri);

        List<Writable> next;
        try (DataInputStream dis = new DataInputStream(new BufferedInputStream(new FileInputStream(f)))) {
            next = record(uri, dis);
        }
        out.add(new org.datavec.api.records.impl.Record(next, meta));
    }
    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:16,代码来源:BaseImageRecordReader.java

示例3: loadSequenceFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<SequenceRecord> loadSequenceFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {
    List<SequenceRecord> out = new ArrayList<>();
    for (RecordMetaData meta : recordMetaDatas) {
        File f = new File(meta.getURI());

        List<List<Writable>> list = loadData(f, null);
        out.add(new org.datavec.api.records.impl.SequenceRecord(list, meta));
    }

    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:13,代码来源:BaseCodecRecordReader.java

示例4: loadFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<Record> loadFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {
    List<Record> out = new ArrayList<>();

    for (RecordMetaData meta : recordMetaDatas) {
        URI uri = meta.getURI();

        File f = new File(uri);
        List<Writable> list = loadFromFile(f);
        out.add(new org.datavec.api.records.impl.Record(list, meta));
    }

    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:15,代码来源:FileRecordReader.java

示例5: loadSequenceFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<SequenceRecord> loadSequenceFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {
    List<SequenceRecord> out = new ArrayList<>();
    for (RecordMetaData meta : recordMetaDatas) {
        File next = new File(meta.getURI());
        URI uri = next.toURI();
        String fileContents = FileUtils.readFileToString(next, charset.name());
        List<List<Writable>> sequence = loadSequence(fileContents, uri);
        out.add(new org.datavec.api.records.impl.SequenceRecord(sequence, meta));
    }
    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:13,代码来源:RegexSequenceRecordReader.java

示例6: loadSequenceFromMetaData

import org.datavec.api.records.metadata.RecordMetaData; //导入方法依赖的package包/类
@Override
public List<SequenceRecord> loadSequenceFromMetaData(List<RecordMetaData> recordMetaDatas) throws IOException {
    List<SequenceRecord> out = new ArrayList<>();
    for (RecordMetaData meta : recordMetaDatas) {
        File next = new File(meta.getURI());
        List<List<Writable>> sequence = loadAndClose(new FileInputStream(next));
        out.add(new org.datavec.api.records.impl.SequenceRecord(sequence, meta));
    }
    return out;
}
 
开发者ID:deeplearning4j,项目名称:DataVec,代码行数:11,代码来源:CSVSequenceRecordReader.java


注:本文中的org.datavec.api.records.metadata.RecordMetaData.getURI方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。