CUQI-DTU / CUQIpy

https://cuqi-dtu.github.io/CUQIpy/
Apache License 2.0
44 stars 9 forks source link

Enable FD gradient when sampling with NUTS within Gibbs #493

Open amal-ghamdi opened 2 months ago

amal-ghamdi commented 2 months ago

Description:

What we have already In CUQIpy, gradient-based sampling methods (including NUTS) can use FD gradient. This is done by enabling the FD gradient for the target before passing it to the sampling methods. E.g. for the posterior object posterior, one can add the line

posterior.enable_FD()

Before passing it to the sampler.

What is missing Using NUTS (or any other gradient-based sampling method) within HybridGibbs and enabling FD approximation in the target does not work at the moment. One solution is implemented in the associated PR #492, but it is worth thinking about what is the best approach to achieve that (e.g. modifying Gibbs instead of NUTS? or modifying all gradient-based samplers)

DoD:

amal-ghamdi commented 2 months ago

@nabriis, any thoughts?

(tagging to keep you in the loop @jakobsj , @chaozg)