Backend independence a la pyhf
phinate opened this issue · comments
pyhf
has this awesome feature that it's inherently backend-independent thanks to the implementation of the pyhf.tensor
submodule. I've ripped that straight out of pyhf
, and used two of its functions for implementations of a differentiable histogram and cut.
This needs to be cleaned up to only use things that are actually used in practice, and additional support for fixed point differentiation needs to be added for backends other than jax
. The code taken from neos
also needs to be adapted to follow the protocol in tensor
.
Closing for now, as a jax
-only solution seems like a viable way forward since gradients can be more easily transferred between frameworks due to recent work :)