We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
safe_cumprod
cumprod in the MoChA paper is defined to be exclusive, while the safe_cumprod in this repo does not. Shouldn't it be:
def safe_cumprod(self, x, exclusive=False): """Numerically stable cumulative product by cumulative sum in log-space""" bsz = x.size(0) logsum = torch.cumsum(torch.log(torch.clamp(x, min=1e-20, max=1)), dim=1) if exclusive: logsum = torch.cat([torch.zeros(bsz, 1).to(logsum), logsum], dim=1)[:, :-1] return torch.exp(logsum)
And in the function soft() of MonotonicAttention:
soft()
MonotonicAttention
cumprod_1_minus_p = self.safe_cumprod(1 - p_select, exclusive=True)
The text was updated successfully, but these errors were encountered:
@bo-son I think you're right
Sorry, something went wrong.
No branches or pull requests
cumprod in the MoChA paper is defined to be exclusive, while the
safe_cumprod
in this repo does not. Shouldn't it be:And in the function
soft()
ofMonotonicAttention
:The text was updated successfully, but these errors were encountered: