Skip to content

Commit 649b094

Browse files
committed
Update docs of distribution properties
1 parent 08a779d commit 649b094

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

supar/structs/dist.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,31 +29,31 @@ def __repr__(self):
2929
@lazy_property
3030
def log_partition(self):
3131
r"""
32-
Computes the log partition function.
32+
Computes the log partition function of the distribution :math:`p(y)`.
3333
"""
3434

3535
return self.forward(LogSemiring)
3636

3737
@lazy_property
3838
def marginals(self):
3939
r"""
40-
Computes marginals of the distribution :math:`p(y)`.
40+
Computes marginal probabilities of the distribution :math:`p(y)`.
4141
"""
4242

4343
return self.backward(self.log_partition.sum())
4444

4545
@lazy_property
4646
def max(self):
4747
r"""
48-
Computes the max score of distribution :math:`p(y)`.
48+
Computes the max score of the distribution :math:`p(y)`.
4949
"""
5050

5151
return self.forward(MaxSemiring)
5252

5353
@lazy_property
5454
def argmax(self):
5555
r"""
56-
Computes :math:`\arg\max_y p(y)` of distribution :math:`p(y)`.
56+
Computes :math:`\arg\max_y p(y)` of the distribution :math:`p(y)`.
5757
"""
5858
raise NotImplementedError
5959

@@ -63,20 +63,20 @@ def mode(self):
6363

6464
def kmax(self, k):
6565
r"""
66-
Computes the k-max of distribution :math:`p(y)`.
66+
Computes the k-max of the distribution :math:`p(y)`.
6767
"""
6868

6969
return self.forward(KMaxSemiring(k))
7070

7171
def topk(self, k):
7272
r"""
73-
Computes the k-argmax of distribution :math:`p(y)`.
73+
Computes the k-argmax of the distribution :math:`p(y)`.
7474
"""
7575
raise NotImplementedError
7676

7777
def sample(self):
7878
r"""
79-
Computes structured samples from the distribution :math:`y \sim p(y)`.
79+
Obtains a structured sample from the distribution :math:`y \sim p(y)`.
8080
TODO: multi-sampling.
8181
"""
8282

@@ -85,7 +85,7 @@ def sample(self):
8585
@lazy_property
8686
def entropy(self):
8787
r"""
88-
Computes entropy :math:`H[p]` of distribution :math:`p(y)`.
88+
Computes entropy :math:`H[p]` of the distribution :math:`p(y)`.
8989
"""
9090

9191
return self.forward(EntropySemiring)

0 commit comments

Comments
 (0)