3 ms·
How's AD different from simply calling the function with a slightly perturbed input and observing how much the output changes? I assume it's more efficient with
by RivieraKid 8y ago
How's AD different from simply calling the function with a slightly perturbed input and observing how much the output changes? I assume it's more efficient with multivariable functions because the aforementioned method requires one call per parameter?
- shoyer 8y agoIt is indeed much more efficient. In general, you can evaluate a scalar function and its gradient with less than twice the effort required to compute the scalar function alone -- regardless of the number of parameters.
- sampo 8y ago> How's AD different from simply calling the function with a slightly perturbed input and observing how much the output changes? AD gives a more precise result, as AD calculates the value of the derivative at the point you want without any perturbed input. AD is also faster, as calculating the value of the derivative usually requires about the same number of elementary operations as calculating the value of the function. Whereas with finite difference you need to calculate the function twice.