concept
Loss and derivatives
A derivative measures local rate of change where the limit exists. For L(w) = (w−3)², L′(w) = 2(w−3). Partial derivatives hold other coordinates fixed; a zero gradient does not prove a minimum.
Formal Syntax & Structure
artificial-intelligence syntaxartificial-intelligence
L′(w) = lim(h→0) [L(w+h) − L(w)] / h; gradient = vector of partial derivativesWorking Example
Example Snippetartificial-intelligence
def loss(w): return (w - 3) ** 2
def slope(w): return 2 * (w - 3)
for w in (1, 3, 4): print(w, loss(w), slope(w))