Companion

object Companion

Functions

convertByteToFloat
Link copied to clipboard
fun convertByteToFloat(label: Byte): Float

Creates float label.

create
Link copied to clipboard
fun create(preprocessors: Preprocessing): OnHeapDataset

Use preprocessors to prepare data to create dataset OnHeapDataset.

fun create(features: Array<FloatArray>, labels: FloatArray): OnHeapDataset

Takes data from external data features and labels to create dataset OnHeapDataset.

fun create(featuresConsumer: () -> Array<FloatArray>, labelConsumer: () -> FloatArray): OnHeapDataset

Takes data from consumers featuresConsumer and labelConsumer to dataset OnHeapDataset.

fun create(preprocessors: Preprocessing, labels: FloatArray): OnHeapDataset

Use preprocessors and labels to prepare data to create dataset OnHeapDataset.

fun create(featuresPath: String, labelsPath: String, numClasses: Int, featuresExtractor: (String) -> Array<FloatArray>, labelExtractor: (String, Int) -> FloatArray): OnHeapDataset

Takes data located in featuresPath, labelsPath with numClasses, extracts data and labels via featuresExtractor and labelExtractor to create pair of train and test OnHeapDataset.

createTrainAndTestDatasets
Link copied to clipboard
fun createTrainAndTestDatasets(trainFeaturesPath: String, trainLabelsPath: String, testFeaturesPath: String, testLabelsPath: String, numClasses: Int, featuresExtractor: (String) -> Array<FloatArray>, labelExtractor: (String, Int) -> FloatArray): Pair<OnHeapDataset, OnHeapDataset>

Takes data located in trainFeaturesPath, trainLabelsPath, testFeaturesPath, testLabelsPath with numClasses, extracts data and labels via featuresExtractor and labelExtractor to create pair of train and test OnHeapDataset.

toNormalizedVector
Link copied to clipboard
fun toNormalizedVector(bytes: ByteArray): FloatArray

Normalizes bytes via division on 255 to get values in range '[0; 1)'.

toOneHotVector
Link copied to clipboard
fun toOneHotVector(numClasses: Int, label: Byte): FloatArray

Creates binary vector with size numClasses from label.

toRawVector
Link copied to clipboard
fun toRawVector(bytes: ByteArray): FloatArray

Converts bytes to FloatArray.