gd_step

std.optim.gd_step · Level L1

One step of gradient descent for any model, given its gradient df(w, X, y): w − η·df(w, X, y). A template over df; the body minimize_gd scans.

w′ = w − η·∇f(w)

Signature

gd_step(w: f64[d], lr: f64[], X: f64[n, d], y: f64[n]) → f64[d]

Structure

The function as NOVA stores it: one box per input, operation and output, and arrows that carry values. A double border marks another library function this one runs — called once, or by Scan once per element; select it to open that function.

wf64[d]lrf64[]Xf64[n, d]yf64[n]$dfgMultiplystepSubtractw2w2f64[d]
  • input
  • operation
  • constant
  • call
  • output

Verification

  • Signature proven by NOVA’s shape solver, for every size.
  • Agrees with the reference witness df = logistic_grad: w - lr * logistic_grad(w, X, y) to 80 digits (100-digit arithmetic), on all 40 test cases.
  • All 157 float64 results inside the running error bound; the closest uses 55% of it.
  • Interpreter and NumPy backend return bit-identical results.
  • At float32 too: the 40 test cases rounded to float32, and 40 of them inside the running error bound at u = 2⁻²⁴; the closest uses 81% of it.
Accuracy in detail
correctly rounded (the float64 nearest the exact value)
77%
bit-equal to the NumPy formula in float64
100%
largest error, in units in the last place
3.84

Identity

Calls
—
Called by
sha256:43aeb5e04c49cc47aabab3fc05f232c57d47ae844cbee9611b89b84896b35ed0

The semantic hash of the graph. It changes when the program changes, and never when only its documentation does.

Control handle

Symbol
Ω:std.optim.gd_step[df=std.optim.logistic_grad]
Pins
sha256:cb1345ef2f81288a932202f2a542d938640f0237eae8696bb2a22bb85a263017this graph and the 1 it reaches through calls
Evidence
sha256:235c366f86a6db503c4ad6e7515a359bf8cb5133c62c845d6de88f276e53f75bthe hash of its verification record
Needs
no capability: a pure function

Through NOVA’s control layer, the symbol launches this function only while the program still matches what it pins: a change to this graph, or to any graph it reaches, needs a migration first.

ΣEML 2026

Efficient New Language — a high-density semantic overlay for humans and AI agents.

This site’s demos run on the real EML toolchain, in your browser.

© 2026 EveMissLab (一言諾科技有限公司) / Neo.K. All rights reserved.