Package-level declarations

Types

Link copied to clipboard
class Accuracy(dim: Int = -1, threshold: Float? = null) : Metric

Classification accuracy metric.

Link copied to clipboard
interface Metric

Interface for evaluation metrics that accumulate statistics over batches.

Functions

Link copied to clipboard
fun accuracy(dim: Int = -1, threshold: Float? = null): Metric

Factory function for Accuracy metric.

Link copied to clipboard
fun binaryAccuracy(threshold: Float = 0.5f): Metric

Binary accuracy metric with a threshold of 0.5. Useful for binary classification problems with sigmoid outputs.

Link copied to clipboard
fun <T : DType, V> Metric.computeForBatch(predictions: Tensor<T, V>, targets: Tensor<out DType, *>, ctx: ExecutionContext): Double

Convenience function to compute a metric for a single batch without accumulation. Returns the metric value directly.