Skip to content

Commit

Permalink
Fix - tf.log does not exist
Browse files Browse the repository at this point in the history
  • Loading branch information
louisPoulain committed Sep 13, 2024
1 parent 8e7a831 commit 4d61174
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mlpp_lib/probabilistic_layers.py
Original file line number Diff line number Diff line change
Expand Up @@ -391,9 +391,9 @@ def _log_prob(self, value):
cdf = lambda x: tfd.Normal(0, 1).cdf(x)
pdf = lambda x: tfd.Normal(0, 1).prob(x)

logprob_left = lambda x: tf.log(cdf(-mu / sigma) + 1e-3)
logprob_left = lambda x: tf.math.log(cdf(-mu / sigma) + 1e-3)
logprob_middle = lambda x: self.normal.log_prob(x)
logprob_right = lambda x: tf.log(1 - cdf((1 - mu) / sigma) + 1e-3)
logprob_right = lambda x: tf.math.log(1 - cdf((1 - mu) / sigma) + 1e-3)

return logprob_left(value) + logprob_middle(value) + logprob_right(value)

Expand Down

0 comments on commit 4d61174

Please sign in to comment.