Bendtorch.Train.step: def of bendtorch@1.3.0.0 Import: import bendtorch@1.3.0.0/main.bend as Bendtorch Lines 946-950 of bendtorch@1.3.0.0/main.bend: https://jend.leeeet.dev/read.txt?path=bendtorch@1.3.0.0/main.bend&start_line=946&end_line=950 import Base # forward, loss, backward and one optimizer step: the same code for every model def Train.step(~P: Type, ~X: Type, ~Y: Type, ~S: Type, ~T: Type, ~m: Layer
, ~loss: Y -> T -> LossOut , x: X, t: T) -> Train :
match tr:
case Train{p, g, st, p1, p2, l}:
ts2(~P, ~X, ~Y, ~S, ~T, ~m, ~loss, cfg, g, st, p1, p2, t, Layer.fwd(P, X, Y, S, m, p, x))
Uses (6):
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=Layer.fwd
https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=LossOut
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=Train
https://jend.leeeet.dev/definition.txt?path=bendtorch@1.3.0.0/main.bend&name=ts2