Skip to content

Commit

Permalink
.
Browse files Browse the repository at this point in the history
  • Loading branch information
srush committed Sep 7, 2019
1 parent c7b9bd5 commit 4954d69
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions torch_struct/deptree.py
Original file line number Diff line number Diff line change
Expand Up @@ -195,12 +195,12 @@ def sstack(a):
# Compute reverses
alpha[B][I][:, :, k:N, N - k - 1] = alpha[A][I][:, :, : N - k, k]

print("here")

v = alpha[A][C][R, :, 0, 0]
left = semiring.times(alpha[A][I][L, :, :, :], alpha_in[A][I][L, :, :, :])
right = semiring.times(alpha[A][I][R, :, :, :], alpha_in[A][I][R, :, :, :])
ret = torch.zeros(batch, N, N).type_as(left)
for k in range(N):
for k in torch.arange(N):
f = torch.arange(N - k), torch.arange(k, N)
ret[:, f[1], k] = left[:, k, f[0]]
ret[:, k, f[1]] = right[:, k, f[0]]
Expand Down
2 changes: 1 addition & 1 deletion torch_struct/semirings.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def one():

@staticmethod
def div_exp(a, b):
return a.exp().div(b.exp())
return (a - b).exp()


class LogSemiring(_BaseLog):
Expand Down

0 comments on commit 4954d69

Please sign in to comment.