public class LossResult<T extends AbstractFloat = Float>
A mean batch loss and its derivative with respect to model outputs.
result = SparseCategoricalCrossentropy<Float>().compute(logits, labels)
| Modifier and Type | Member | Description |
|---|---|---|
| public readonly property | gradientgradient as NDArray<T> |
Mean-reduced output gradient, including an optional loss-scaling factor. |
| public readonly property | valuevalue as Double |
Mean scalar loss accumulated in FP64. |
| Modifier and Type | Member | Description |
|---|---|---|
| public | LossResultLossResult(value as Double, gradient as NDArray<T>) |
Retains a scalar loss and its gradient without copying the array. |