[K/N] Replaced usage of minBy/maxBy in samples and benchmarks
This commit is contained in:
committed by
Pavel Punegov
parent
d2d324797b
commit
53c80cf03b
@@ -17,7 +17,7 @@ fun Float.toRoundedString(digits: Int = 0): String {
|
||||
|
||||
fun Float.toPercentageString(roundToDigits: Int = 1) = (this * 100).toRoundedString(roundToDigits)
|
||||
|
||||
fun List<Float>.maxIndex() = withIndex().maxBy { it.value }!!.index
|
||||
fun List<Float>.maxIndex() = withIndex().maxByOrNull { it.value }!!.index
|
||||
|
||||
fun accuracy(predictionBatch: FloatMatrix, labelBatch: FloatMatrix): Float {
|
||||
val resultIndexes = predictionBatch.toList().map { it.maxIndex() }
|
||||
|
||||
Reference in New Issue
Block a user