Skip to content

Commit ccf9ca0

Browse files
committed
Deal with inference_network.log_prob to return dict (as PointInferenceNetwork does)
1 parent 265f667 commit ccf9ca0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bayesflow/approximators/continuous_approximator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -458,7 +458,7 @@ def log_prob(self, data: Mapping[str, np.ndarray], **kwargs) -> np.ndarray | dic
458458
# change of variables formula
459459
log_det_jac = log_det_jac.get("inference_variables")
460460
if log_det_jac is not None:
461-
log_prob = log_prob + log_det_jac
461+
log_prob = keras.tree.map_structure(lambda x: x + log_det_jac, log_prob)
462462

463463
return log_prob
464464

0 commit comments

Comments
 (0)