Bendtorch.Softmax: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 1447-1449 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=1447&end_line=1449 import Base import bend-ml-tensor-array@0.1.18.0/main.bend as TA # softmax over each row; saves its output def Softmax(+n: Nat, +c: Nat) -> Layer, TA.Mat, TA.Mat>: Layer{p => x => sm_fwd(n, c, x), p => s => dy => g => sm_bwd(n, c, s, dy), op => p => g => st => no_step(Unit, op, p, g, st), u => Unit{}, p => PL{p, Nil{}}, p => xs => off => PA{p, xs, off}, p => xs => off => PA{p, xs, off}, u => 0} Uses (10): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=List https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Nat https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Unit https://jend.leeeet.dev/definition.txt?path=bend-ml-tensor-array@0.1.19.0/main.bend&name=Mat https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Layer https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=PA https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=PL https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=no_step https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=sm_bwd https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=sm_fwd