def check_gradient():
    x = np.array([4, 10], dtype=np.float64)
    (value, grad) = simple_quadratic_function(x)

    num_grad = compute_gradient(simple_quadratic_function, x)
    print num_grad, grad
    print "The above two columns you get should be very similar.\n" \
          "(Left-Your Numerical Gradient, Right-Analytical Gradient)\n"

    diff = np.linalg.norm(num_grad + grad) / np.linalg.norm(num_grad - grad)
    print diff
    print "Norm of the difference between numerical and analytical num_grad (should be < 1e-9)\n"
dataset/ETHPy150Open jatinshah/ufldl_tutorial/gradient.py/check_gradient/swapped operands of `/`