Package io.github.kirstenali.deepj.data
Class RandomAccessTextDataset
java.lang.Object
io.github.kirstenali.deepj.data.RandomAccessTextDataset
- All Implemented Interfaces:
BatchSource,StatefulBatchSource,StatefulTrainingDataset,AutoCloseable
-
Constructor Summary
ConstructorsConstructorDescriptionRandomAccessTextDataset(Path path, Tokenizer tokenizer, int seqLen, long seed) RandomAccessTextDataset(Path path, Tokenizer tokenizer, int seqLen, long seed, TextFileRange range) -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()nextBatch(int batchSize) longvoidrestoreRandomState(long state)
-
Constructor Details
-
RandomAccessTextDataset
public RandomAccessTextDataset(Path path, Tokenizer tokenizer, int seqLen, long seed) throws IOException - Throws:
IOException
-
RandomAccessTextDataset
public RandomAccessTextDataset(Path path, Tokenizer tokenizer, int seqLen, long seed, TextFileRange range) throws IOException - Throws:
IOException
-
-
Method Details
-
nextBatch
- Specified by:
nextBatchin interfaceBatchSource
-
randomState
public long randomState()- Specified by:
randomStatein interfaceStatefulBatchSource
-
restoreRandomState
public void restoreRandomState(long state) - Specified by:
restoreRandomStatein interfaceStatefulBatchSource
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
IOException
-