def Vec.softmax
import bend-tensors@0.0.0.2/bend_tensors.bend as BendTensorsimport Base
1405# exp(v - max v) / sum, over the m elements
1406def Vec.softmax(+m: Nat, +v: Vec<m>) -> Vec<m>:
1407 Vec.softmax.fin(m, Vec.exp(m, Vec.shift(m, (0.0 - Vec.max(m, v) : F32), v)))
Uses (8)
Used by (0)
No other definition uses this definition.