public abstract static class RandomAccessDataset.BaseBuilder<T extends RandomAccessDataset.BaseBuilder>
extends java.lang.Object
RandomAccessDataset.| Modifier and Type | Field and Description |
|---|---|
protected Batchifier |
batchifier |
protected Device |
device |
protected java.util.concurrent.ExecutorService |
executor |
protected long |
maxIteration |
protected Pipeline |
pipeline |
protected int |
prefetchNumber |
protected Sampler |
sampler |
protected Pipeline |
targetPipeline |
| Constructor and Description |
|---|
BaseBuilder() |
| Modifier and Type | Method and Description |
|---|---|
Sampler |
getSampler()
Gets the
Sampler for the dataset. |
T |
optBatchier(Batchifier batchier)
Sets the
Batchifier for the dataset. |
T |
optDevice(Device device)
Sets the
Device. |
T |
optExcutor(java.util.concurrent.ExecutorService executor,
int prefetchNumber)
Sets the
ExecutorService to spawn threads to fetch data. |
T |
optMaxIteration(long maxIteration)
Sets the maximum number of iterations.
|
T |
optPipeline(Pipeline pipeline)
|
T |
optTargetPipeline(Pipeline targetPipeline)
|
protected abstract T |
self()
Returns this {code Builder} object.
|
T |
setSampling(int batchSize,
boolean random)
Sets the
Sampler with the given batch size. |
T |
setSampling(int batchSize,
boolean random,
boolean dropLast)
Sets the
Sampler with the given batch size. |
T |
setSampling(Sampler sampler)
Sets the
Sampler for the dataset. |
protected Sampler sampler
protected Batchifier batchifier
protected Pipeline pipeline
protected Pipeline targetPipeline
protected java.util.concurrent.ExecutorService executor
protected int prefetchNumber
protected long maxIteration
protected Device device
public T setSampling(int batchSize, boolean random)
Sampler with the given batch size.batchSize - the batch sizerandom - whether the sampling has to be randomBaseBuilderpublic T setSampling(int batchSize, boolean random, boolean dropLast)
Sampler with the given batch size.batchSize - the batch sizerandom - whether the sampling has to be randomdropLast - whether to drop the last incomplete batchBaseBuilderpublic T setSampling(Sampler sampler)
Sampler for the dataset.sampler - the Sampler to be setBaseBuilderpublic T optBatchier(Batchifier batchier)
Batchifier for the dataset.batchier - the Batchifier to be setBaseBuilderpublic T optExcutor(java.util.concurrent.ExecutorService executor, int prefetchNumber)
ExecutorService to spawn threads to fetch data.executor - the ExecutorService to spawn threadsprefetchNumber - the number of samples to prefetch at onceBaseBuilderpublic T optDevice(Device device)
Device.device - the deviceBaseBuilderpublic T optMaxIteration(long maxIteration)
maxIteration - the maximum number of iterationsBaseBuilderprotected abstract T self()
BaseBuilder