OnHeapDataset

class OnHeapDataset : Dataset

Basic class to handle features x and labels y.

It loads the whole data from disk to the Heap Memory.

NOTE: Labels y should have shape and contain exactly one 1 and other 0-es per row to be result of one-hot-encoding.

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(): OnHeapDataset

Shuffles the dataset.

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

Splits datasets on two sub-datasets according splitRatio.

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

Returns amount of data rows.

Properties

x
Link copied to clipboard
val x: Array<FloatArray>
y
Link copied to clipboard
val y: FloatArray