Skip to content

Commit 50bd788

Browse files
committed
Entropy quantities for non-proj trees
1 parent a679aeb commit 50bd788

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

supar/structs/tree.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def sample(self):
6969

7070
@lazy_property
7171
def entropy(self):
72-
raise NotImplementedError
72+
return self.log_partition - (self.marginals * self.scores).sum((-1, -2))
7373

7474
def cross_entropy(self, other):
7575
raise NotImplementedError

0 commit comments

Comments
 (0)