tpapp / ImplicitDifferentiables.jl

Julia packages that represent a differentiable mapping with implicitly defined values
Other
0 stars 0 forks source link

Differences with ImplicitDifferentiation.jl #2

Open gdalle opened 2 years ago

gdalle commented 2 years ago

Hi there! Glad to see that differentiation of implicit functions is a hot topic :wink: I am also developing a package for that purpose: https://github.com/gdalle/ImplicitDifferentiation.jl Maybe we should join forces instead of duplicating the work?

tpapp commented 2 years ago

Thanks for reaching out. I agree that we should not duplicate work, and your package is very neatly written so I would be happy to contribute.

This package is currently an experiment for the following:

  1. conceptually, given an x::AbstractVector, map to a "model" m = p(x) and then f(p) (eg scalar), but x may never be constructed, we work with the opaque object p

  2. the mapping is defined by solving an implicit function g(p, y) = 0 for y(p), and then f(p) = h(p, y)

  3. the supported interface is A. calculating f(x) and f'(x) from p, pretending we map from x B. translating the p corresponding to x by d to p2 = m(x .+ d), again without necessarily constructing x .+ d. This allows reusing y(p) + dy/dx * d as an initial guess for the iterative solver in the condition.

Currently, I am working on refining the interface, while using this in an actual research project, so this repo is for fast experimentation. I would recommend that once I am done, we assess what can be merged and decide how to proceed.

gdalle commented 2 years ago

Thanks for your answer! Not sure I understand it entirely but I'll let you work on it, just ping me when you reach a stable state :) Btw, Mohamed and I will present ImplicitDifferentiation.jl at JuliaCon (if it gets accepted), so maybe we can chat then