Skip to content

Commit 5b9fdf4

Browse files
committed
continuous approximator returns log_prob with volume correction
1 parent 1957ee8 commit 5b9fdf4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

bayesflow/approximators/continuous_approximator.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -394,12 +394,12 @@ def log_prob(self, data: Mapping[str, np.ndarray], **kwargs) -> np.ndarray | dic
394394
np.ndarray
395395
Log-probabilities of the distribution `p(inference_variables | inference_conditions, h(summary_conditions))`
396396
"""
397-
data = self.adapter(data, strict=False, stage="inference", **kwargs)
397+
data, jacobian = self.adapter(data, strict=False, stage="inference", jacobian=True, **kwargs)
398398
data = keras.tree.map_structure(keras.ops.convert_to_tensor, data)
399399
log_prob = self._log_prob(**data, **kwargs)
400400
log_prob = keras.tree.map_structure(keras.ops.convert_to_numpy, log_prob)
401401

402-
return log_prob
402+
return log_prob + jacobian["inference_variables"]
403403

404404
def _log_prob(
405405
self,

0 commit comments

Comments
 (0)