def CrossEntropy

bendtorch-gpu@1.3.0.0 · main.bend:1610

import bendtorch-gpu@1.3.0.0/main.bend as BendtorchGpu
import Base
import bend-ml-tensor-array@0.1.18.0/main.bend as TA
import bendtorch@1.3.0.0/main.bend as T

1610# cross-entropy over n rows of c classes against the labels (main.bend's CrossEntropy; its bits but CUDA's exp)
1611def CrossEntropy(+n: Nat, +c: Nat, z: TA.Mat<n, c>, +labels: List<&2, Nat>) -> T.LossOut<TA.Mat<n, c>>:
1612  match z:
1613    case TA.Mat{d}: cx_1(n, c, labels, d, ids_arr(n, labels))

Uses (6)

Used by (0)

No other definition uses this definition.