grad_check module

grad_check.eval_numerical_gradient(f, x, verbose=True, h=1e-05)

a naive implementation of numerical gradient of f at x - f should be a function that takes a single argument - x is the point (numpy array) to evaluate the gradient at

From: https://cs231n.github.io/assignments2021/assignment2/

grad_check.eval_numerical_gradient_array(f, x, df, h=1e-05)

Evaluate a numeric gradient for a function that accepts a numpy array and returns a numpy array.

From: https://cs231n.github.io/assignments2021/assignment2/

grad_check.numerical_gradient_check_model(x, y, model, loss)