Java Code Examples for org.datavec.api.records.reader.RecordReader#resetSupported()

The following examples show how to use org.datavec.api.records.reader.RecordReader#resetSupported() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: RecordReaderMultiDataSetIterator.java    From deeplearning4j with Apache License 2.0 6 votes vote down vote up
private RecordReaderMultiDataSetIterator(Builder builder) {
    this.batchSize = builder.batchSize;
    this.alignmentMode = builder.alignmentMode;
    this.recordReaders = builder.recordReaders;
    this.sequenceRecordReaders = builder.sequenceRecordReaders;
    this.inputs.addAll(builder.inputs);
    this.outputs.addAll(builder.outputs);
    this.timeSeriesRandomOffset = builder.timeSeriesRandomOffset;
    if (this.timeSeriesRandomOffset) {
        timeSeriesRandomOffsetRng = new Random(builder.timeSeriesRandomOffsetSeed);
    }


    if(recordReaders != null){
        for(RecordReader rr : recordReaders.values()){
            resetSupported &= rr.resetSupported();
        }
    }
    if(sequenceRecordReaders != null){
        for(SequenceRecordReader srr : sequenceRecordReaders.values()){
            resetSupported &= srr.resetSupported();
        }
    }
}
 
Example 2
Source File: VasttextDataIterator.java    From scava with Eclipse Public License 2.0 5 votes vote down vote up
private VasttextDataIterator(Builder builder) {
	this.batchSize = builder.batchSize;
	this.recordReaders = builder.recordReaders;
	this.inputs.addAll(builder.inputs);
	this.outputs.addAll(builder.outputs);

	if (recordReaders != null) {
		for (RecordReader rr : recordReaders.values()) {
			resetSupported &= rr.resetSupported();
		}
	}
}
 
Example 3
Source File: ConcatenatingRecordReader.java    From DataVec with Apache License 2.0 5 votes vote down vote up
@Override
public boolean resetSupported() {
    for(RecordReader rr : readers){
        if(!rr.resetSupported()){
            return false;
        }
    }
    return true;
}
 
Example 4
Source File: ComposableRecordReader.java    From DataVec with Apache License 2.0 5 votes vote down vote up
@Override
public boolean resetSupported() {
    for(RecordReader rr : readers){
        if(!rr.resetSupported()){
            return false;
        }
    }
    return true;
}
 
Example 5
Source File: AnalyzeLocal.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
/**
 * Analyse the specified data - returns a DataAnalysis object with summary information about each column
 *
 * @param schema Schema for data
 * @param rr     Data to analyze
 * @return DataAnalysis for data
 */
public static DataAnalysis analyze(Schema schema, RecordReader rr, int maxHistogramBuckets){
    AnalysisAddFunction addFn = new AnalysisAddFunction(schema);
    List<AnalysisCounter> counters = null;
    while(rr.hasNext()){
        counters = addFn.apply(counters, rr.next());
    }

    double[][] minsMaxes = new double[counters.size()][2];

    List<ColumnType> columnTypes = schema.getColumnTypes();
    List<ColumnAnalysis> list = DataVecAnalysisUtils.convertCounters(counters, minsMaxes, columnTypes);


    //Do another pass collecting histogram values:
    List<HistogramCounter> histogramCounters = null;
    HistogramAddFunction add = new HistogramAddFunction(maxHistogramBuckets, schema, minsMaxes);
    if(rr.resetSupported()){
        rr.reset();
        while(rr.hasNext()){
            histogramCounters = add.apply(histogramCounters, rr.next());
        }

        DataVecAnalysisUtils.mergeCounters(list, histogramCounters);
    }

    return new DataAnalysis(schema, list);
}
 
Example 6
Source File: ConcatenatingRecordReader.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Override
public boolean resetSupported() {
    for(RecordReader rr : readers){
        if(!rr.resetSupported()){
            return false;
        }
    }
    return true;
}
 
Example 7
Source File: ComposableRecordReader.java    From deeplearning4j with Apache License 2.0 5 votes vote down vote up
@Override
public boolean resetSupported() {
    for(RecordReader rr : readers){
        if(!rr.resetSupported()){
            return false;
        }
    }
    return true;
}