BendMlLlama.weight: def of bend-ml-llama@0.2.1.0 Import: import bend-ml-llama@0.2.1.0/main.bend as BendMlLlama Lines 1198-1200 of bend-ml-llama@0.2.1.0/main.bend: https://jend.leeeet.dev/read.txt?path=bend-ml-llama@0.2.1.0/main.bend&start_line=1198&end_line=1200 import Base # the weight of a logit v: exp(v/temp - top/temp), top the largest logit (its weight is 1) def weight(+v: F32, +temp: F32, +top: F32) -> F32: F32.exp(F32.sub(F32.div(v, temp), F32.div(top, temp))) Uses (4): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.div https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.exp https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub