5 hidden checks
Build the two tools you will use to check and train every model in this course.
numerical_gradient(f, x, h=1e-5): given a functionfthat takes a 1-D array and returns a number, return an array the same shape asxholding the central-difference estimate of each partial derivative. Nudge one element at a time.gradient_descent(grad, x0, lr, steps): start atx0and applyx = x - lr * grad(x)stepstimes. Return the finalx. Don't modifyx0in place.
- numerical_gradient matches an exact gradientnot run
- numerical_gradient works in 5 dimensionsnot run
- numerical_gradient leaves x unchangednot run
- gradient_descent finds the minimum of a bowlnot run
- gradient_descent takes exactly `steps` stepsnot run