public SparseCategoricalCrossentropy(fromLogits as Boolean = true)
Selects stable log-sum-exp mode or probability mode. Probability mode validates each row sum and clips target probabilities below 1e-7 before the logarithm; the derivative of that clipped region is zero. Logit mode avoids this saturation for very confidently wrong scores.
| Parameter | Description |
|---|---|
fromLogits | True for a linear output; false after Softmax. |
loss = SparseCategoricalCrossentropy<Float>(fromLogits=false)