OnFlyImageDataset

class OnFlyImageDataset<D> : Dataset

This dataset keeps all data on disk and generates batches on the fly using provided dataLoader.

Parameters

x

sources to load data from

y

labels to use for the loaded data

dataLoader

data loader to load data with from the provided sources

Types

Companion
Link copied to clipboard
object Companion

Functions

batchIterator
Link copied to clipboard
fun batchIterator(batchSize: Int): Dataset.BatchIterator

Returns BatchIterator with fixed batchSize.

getX
Link copied to clipboard
open override fun getX(idx: Int): FloatArray

Returns row by index idx.

getY
Link copied to clipboard
open override fun getY(idx: Int): Float

Returns label as FloatArray by index idx.

shuffle
Link copied to clipboard
open override fun shuffle(): OnFlyImageDataset<D>

Shuffles the dataset.

split
Link copied to clipboard
open override fun split(splitRatio: Double): Pair<OnFlyImageDataset<D>, OnFlyImageDataset<D>>

Splits datasets on two sub-datasets according splitRatio.

xSize
Link copied to clipboard
open override fun xSize(): Int

Returns amount of data rows.