Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjoint sensitivities #88

Open
7 of 11 tasks
martinjrobins opened this issue Sep 7, 2024 · 0 comments
Open
7 of 11 tasks

adjoint sensitivities #88

martinjrobins opened this issue Sep 7, 2024 · 0 comments

Comments

@martinjrobins
Copy link
Owner

martinjrobins commented Sep 7, 2024

add ability to calculate gradient of some output function wrt parameters using adjoint sensitivities (faster than forward sensitivities models with 100s of parameters)

  • add ability to solve in reverse time (initial negative h?) #92
  • add checkpointing #94
    • refactor solver state to be a solver specific struct and implement a new trait SolverState, each solver can be save or load their state and resume
    • write a generic checkpointing struct that can (a) save a particular solve as a sequence of states defining a list of n segments of the solution trajectory, (b) activate segment i and (c) interpolate the solution at any point in segment i
  • event pullbacks #100
  • write adjoint equations #98
  • new solver trait functions:
    • solve_integrate_adjoint(t_max): solves adjoint problem with a functional given by f = \int_0^t_max out(t) dt. Returns dfdp, where p is the parameter vector and dfdp is a dense matrix. Steps are (a) do forward solve, (b) save forward solve as checkpointing and create adjoint equations (c) solve adjoint equations in reverse time, (d) return solution of adjoint equations at final time as the result
    • solve_sum_squared_adjoint(t_discrete, data): solves adjoint problem with functional given by f = sum_i (out(t_i) - data_i)^2. Returns same as above. Steps are (a) do forward solve, (b) save forward solve as checkpointing and create adjoint equations (c) solve adjoint equations in reverse time, using event pullbacks to adjust the state at each data point (d) return solution of adjoint equations at final time as the result
    • add solve_integrate and solve_sum_squared, same as above but return value of f instead. Implement
    • add solve_integrate_fwd and solve_sum_squared_fwd, same as above but use forward sensitivities instead of adjoints
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant