Bendtorch.train_at_b: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 952-958 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=952&end_line=958 import Base # One owned model, including dimensions captured at run time. Its fwd, bwd and step closures each run once. def train_at_b(-P: Type, -X: Type, sf: Opt -> P -> P -> OptState

-> Step

, +cfg: OptCfg, st: OptState

, +p1: F32, +p2: F32, +l: F32, r: Bwd) -> Train

: match r: case Bwd{p, dx, g}: +q1 = (p1 + (OptCfg.c1(cfg) * (1.0 - p1 : F32) : F32) : F32) +q2 = (p2 + (OptCfg.c2(cfg) * (1.0 - p2 : F32) : F32) : F32) ts5(P, l, q1, q2, sf(Opt.at(cfg, q1, q2), p, g, st)) Uses (14): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.add https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.mul https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32.sub https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Bwd https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Opt https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Opt.at https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptCfg https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptCfg.c1 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptCfg.c2 https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=OptState https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Step https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=Train https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ts5