Skip to content

Commit b28ae2c

Browse files
committed
Fixed log det jac computation of standardize transform
y = (x - mu) / sigma log p(y) = log p(x) - log(sigma)
1 parent 55d3536 commit b28ae2c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

bayesflow/adapters/transforms/standardize.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ def inverse(self, data: np.ndarray, **kwargs) -> np.ndarray:
123123

124124
def log_det_jac(self, data, inverse: bool = False, **kwargs) -> np.ndarray:
125125
std = np.broadcast_to(self.std, data.shape)
126-
ldj = np.log(np.abs(std))
126+
ldj = -np.log(np.abs(std))
127127
if inverse:
128128
ldj = -ldj
129129
return np.sum(ldj, axis=tuple(range(1, ldj.ndim)))

0 commit comments

Comments
 (0)