tpapp / LogDensityProblemsAD.jl

AD backends for LogDensityProblems.jl.
MIT License
12 stars 6 forks source link

Extend API slightly: Allow/encourage dispatch on `ADGradientWrapper` and maybe expose an easy way to "remake"(?) an ADWrapper with a slightly modified wrapped LogDensityProblem. #20

Open nsiccha opened 1 year ago

nsiccha commented 1 year ago

See above, sorry for the long title.

It would be nice to be able to dispatch on wrapped logdensity as e.g. here, but the source code says "[The abstract type ADGradientWrapper] is an implementation helper, not part of the API.", which sounds like one shouldn't dispatch on that type?

Also, it would be nice (i.e. convenient for me related to this issue), if based on some ADGradientWrapper, one could make another one just like it, but with the underlying logdensity replaced.

tpapp commented 1 year ago

I am wary of exposing type fields in the API, you can use parent and then dispatch on that (if you control the function).