OnFlyImageDataset

class OnFlyImageDataset : Dataset

This dataset keeps all data on disk and generates batches on-fly according preprocessing pipeline.

Parameters

preprocessing

The preprocessing pipeline.

labels

Also it could keep labels, if it could be preprocessed separately and passed to this parameter. If it's missed, it will try to generate labels on-fly according org.jetbrains.kotlinx.dl.dataset.preprocessor.generator.LabelGenerator.

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

Shuffles the dataset.

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

Splits datasets on two sub-datasets according splitRatio.

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

Returns amount of data rows.