Finite difference methods, for applications including gradient computation and gradient checks.
The output of your function of interest should be a NumPy array. If your function is scalar-valued, change it to a NumPy array with:
import numpy as np
def function(input_value: float) -> np.ndarray:
scalar_output_value = old_function(input_value)
return np.array([scalar_output_value])
Currently under development, please install from source.
pip install -e .
Can also be installed from PyPI
pip install fiddy