Currently we have two different derivative utilities, approximate_derivative and approximate_derivative_unsummed. We use the first when testing EBM derivatives, the second when testing QNN derivatives. The difference is between comparing expected results to the return from tape.gradient versus the return from tape.jacobian.
This function is also generally wrapped in a function expectations_derivative which iterates through a list of variables, computing their derivatives. The return of this function requires reshaping by the caller to compare to the return of tape.jacobian.
This issue is to combine test_util.approximate_derivative, test_util.approximate_derivative_unsummed, and expectations_derivative into one function that has an interface like tape.jacobian.
Currently we have two different derivative utilities,
approximate_derivative
andapproximate_derivative_unsummed
. We use the first when testing EBM derivatives, the second when testing QNN derivatives. The difference is between comparing expected results to the return fromtape.gradient
versus the return fromtape.jacobian
.This function is also generally wrapped in a function
expectations_derivative
which iterates through a list of variables, computing their derivatives. The return of this function requires reshaping by the caller to compare to the return oftape.jacobian
.This issue is to combine
test_util.approximate_derivative
,test_util.approximate_derivative_unsummed
, andexpectations_derivative
into one function that has an interface liketape.jacobian
.