Compute finite difference gradient of input variable

For the implementation of a paper I need a finite differences approximation of the real gradient with respect to the input variable.

I’ve been trying to use the gradcheck.py ‘get_numerical_jacobian’ function but I think it is not possible to make it compute the gradient of a single Variable, is it?

What would be a good approach to do this?

Many thanks,
David

1 Like