Loss

interface Loss(source)

Contract for loss functions. Implementations should validate shapes/dtypes and return either a scalar (when reduced) or per-element loss tensor.

Inheritors

Functions

Link copied to clipboard
abstract fun <T : DType, V> forward(preds: Tensor<T, V>, targets: Tensor<out DType, *>, ctx: ExecutionContext, reduction: Reduction = Reduction.MEAN): Tensor<T, V>