-
Notifications
You must be signed in to change notification settings - Fork 36
Description
The current implementation of adjoint sensitivities is functional, but very poorly optimized. Currently it just evaluates the full derivative function for the domain and then extracts the one derivative it needs from that in the function g. We then calculate gradients dgdu and dgdp using forward differentiation.
In this scheme in each evaluation of g we evaluate many reactions that are irrelevant to the calculation of the derivative of the species of interest. Ideally we should determine the reactions involving the species of interest and only evaluate those reactions. Additionally it should be much faster to calculate dgdu and dgdp using reverse mode differentiation with ReverseDiff, Tracker or Zygote than forward mode differentiation.
It should also be possible to do even better than the above for specific domains by using analytic dgdu and dgdp.