Skip to content
New issue

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

matching probability m_p #3

Open
sunwoo76 opened this issue Oct 21, 2020 · 0 comments
Open

matching probability m_p #3

sunwoo76 opened this issue Oct 21, 2020 · 0 comments

Comments

@sunwoo76
Copy link

I saw your code like below.

def softmax_with_temperature(self, x, beta, d = 1):
M, _ = x.max(dim=d, keepdim=True)
x = x - M # subtract maximum value for stability
exp_x = torch.exp(beta*x)
exp_x_sum = exp_x.sum(dim=d, keepdim=True)
return exp_x / exp_x_sum

but, in your paper, m_p(q)= softmax(beta * kp * n_p(q)).

According to your paper, It seems that x = x - M -> x = x * M more proper.
Is it right?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant