Skip to content

Commit

Permalink
Update graph_semiring.py
Browse files Browse the repository at this point in the history
  • Loading branch information
Robin Manhaeve authored Jan 4, 2024
1 parent c777cce commit 04cf646
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/deepproblog/semiring/graph_semiring.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ def cross_entropy(
)
else:
if target == 1.0:
loss = -torch.log(p) * weight
loss = -torch.log(p + eps) * weight
elif target == 0.0:
loss = -torch.log(1.0 - p) * weight
loss = -torch.log(1.0 - p + eps) * weight
else:
loss = (
-(
Expand Down

0 comments on commit 04cf646

Please sign in to comment.