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

tau_q is multiplied instead of divison #8

Closed
aakash-saboo opened this issue Jan 9, 2022 · 2 comments
Closed

tau_q is multiplied instead of divison #8

aakash-saboo opened this issue Jan 9, 2022 · 2 comments

Comments

@aakash-saboo
Copy link

Hi.
Thanks for your work @youngkyunJang !
I noticed that to implement equation 1 of the paper i.e to compute the quantization vector using Soft quantization, tau_q is multiplied instead of division.

def Soft_Quantization(X, C, N_books, tau_q):
    L_word = int(C.size()[1]/N_books)
    x = T.split(X, L_word, dim=1)
    c = T.split(C, L_word, dim=1)
    for i in range(N_books):
        soft_c = F.softmax(squared_distances(x[i], c[i]) * (-tau_q), dim=-1)
        if i==0:
            Z = soft_c @ c[i]
        else:
            Z = T.cat((Z, soft_c @ c[i]), dim=1)
    return Z

Please let me know if there is a correction.

Thanks
Aakash

@youngkyunJang
Copy link
Owner

Hello, Thanks for finding the error.

Actually, the paper is written wrong... what I meant was multiplying tau_q to increase the value of squared_distances.

I will update the paper version that fixes the error.

@aakash-saboo
Copy link
Author

Thanks a lot for your quick response!

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

2 participants