Bendtorch.ce_pick: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 3217-3223 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=3217&end_line=3223 import Base # a label past the last class picks probability 0.0, clamped at 1e-12, as tensor-array's pick def ce_pick(ok: Bool, +c: Nat, +off: U32, +idx: U32, loss: F32, z: Array) -> AS: match ok: case True{}: ce_pick3(c, off, loss, Array.get(F32, z, idx)) case False{}: ce_bad(loss, ce_sm(c, off, z)) Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Array.get https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=U32 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=AS https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ce_bad https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ce_pick3 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ce_sm