Package org.jetbrains.kotlinx.dl.impl.util

Functions

argmax
Link copied to clipboard
common
fun FloatArray.argmax(): Int

Returns the index of the maximum element in the given FloatArray. TODO: Should be replaced with Multik in future.

flattenFloats
Link copied to clipboard
fun Array<*>.flattenFloats(): FloatArray

Flattens the given array of float values.

get2D
Link copied to clipboard
common
fun FloatArray.get2D(rowIndex: Int, columnIndex: Int, width: Int): Float
get3D
Link copied to clipboard
common
fun FloatArray.get3D(rowIndex: Int, columnIndex: Int, channelIndex: Int, width: Int, channels: Int): Float
set2D
Link copied to clipboard
common
fun FloatArray.set2D(rowIndex: Int, columnIndex: Int, width: Int, value: Float)
set3D
Link copied to clipboard
common
fun FloatArray.set3D(rowIndex: Int, columnIndex: Int, channelIndex: Int, width: Int, channels: Int, value: Float)
toNormalizedVector
Link copied to clipboard
fun toNormalizedVector(bytes: ByteArray): FloatArray

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

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

Converts bytes to FloatArray.