I am looking for some pointers and resources on whether the following can be efficiently done in Python.
I have a custom function:
def outerfunc(innerfunc(<inputs>), arg1, arg2):
computing outerfunc
returns a numeric value, let's call it result
innerfunc
accepts a few arguments, one of which is a list of numbers, [x1,x2,x3]
and returns an object which is used to perform the calculation
objective:
calculate the sensitivity of result to a perturbation (finite amount) of each of [x1,x2,x3]
so as to obtain a vector of 3 elements - the partial derivatives of result w.r.t. x1, x2, and x3
any resources, examples, advice would be appreciated!
edit: i should elaborate that innerfunc
in this example could come from a third-party source and is not directly built on numpy or edit-able. this is where i am not able to find much references online