Sgd.descend_at: def of bendtorch-core@0.1.0.0 Import: import bendtorch-core@0.1.0.0/src/autograd/sgd.bend as Sgd Lines 127-138 of bendtorch-core@0.1.0.0/src/autograd/sgd.bend: https://jend.leeeet.dev/read.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&start_line=127&end_line=138 import Base import bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend as Backward # Updates entry id of a newest-first list of count entries and keeps every # other entry. def descend_at(+lr: F32, entries: List<&1, Backward.Entry>, +count: Nat, +id: Nat, same: Bool) -> Walked(): match entries count same: case Nil{} count same: (Nil{}, Fail{UnknownNode{}}) case Con{entry, rest} 0n same: (entry <> rest, Fail{UnknownNode{}}) case Con{entry, rest} 1n+below True{}: placed(rest, descend(lr, entry)) case Con{entry, rest} 1n+below False{}: kept(entry, descend_at(lr, rest, below, id, Backward.at_head(below, id))) Uses (13): https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Bool https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=F32 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=Result https://jend.leeeet.dev/definition.txt?path=Base/base.bend&name=Sigma https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&name=Error https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&name=Walked https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&name=descend https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&name=kept https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/sgd.bend&name=placed https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=Entry https://jend.leeeet.dev/definition.txt?path=bendtorch-core@0.1.0.0/src/autograd/tensor_backward.bend&name=at_head