The dependence on torch 1.8 makes sense because the current sbi version, which we want to use, depends on it.
With this change we get rid of the helper function get_log_abs_det_jacobian that was distinguishing between the behavior before and after torch 1.8 and was doing the summation explicitly.
Details:
with the dependence on torch>=1.8 the output of log_prob and log_abs_det_jacobian changes: when the input has several parameter dimensions the output will keep those dimensions and we would have to sum over them by hand to get the joint log_prob over parameter dimensions.
this can be prevented by "reinterpreting" them as batch dimensions.
for transforms this works via the IndependentTransform as a wrapper
The dependence on torch 1.8 makes sense because the current
sbi
version, which we want to use, depends on it.With this change we get rid of the helper function
get_log_abs_det_jacobian
that was distinguishing between the behavior before and after torch 1.8 and was doing the summation explicitly.Details:
torch>=1.8
the output oflog_prob
andlog_abs_det_jacobian
changes: when the input has several parameter dimensions the output will keep those dimensions and we would have to sum over them by hand to get the joint log_prob over parameter dimensions.IndependentTransform
as a wrapperSee also #15