law sgd_descend_scalar

bendtorch-core@0.1.0.0 · src/autograd/sgd_LAWS.bend:15

import bendtorch-core@0.1.0.0/src/autograd/sgd_LAWS.bend as SgdLAWS
import Base
import bendtorch-core@0.1.0.0/src/tensor/elementwise.bend as Elementwise

15# The cell of an SGD step: p - lr * g, with the product rounded before the
16# difference, F32 operation by F32 operation.
17law sgd_descend_scalar:
18  for +lr: F32
19  for +p: F32
20  for +g: F32
21  {Elementwise.scalar(Elementwise.Descend{lr}, p, g) == F32.sub(p, F32.mul(lr, g)) : F32}

Uses (5)

Used by (0)

No other definition uses this definition.