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

the cds formula (context distribution smoothing) is wrong #4

Open
xiaoouwang opened this issue Jan 7, 2022 · 0 comments
Open

the cds formula (context distribution smoothing) is wrong #4

xiaoouwang opened this issue Jan 7, 2022 · 0 comments

Comments

@xiaoouwang
Copy link

xiaoouwang commented Jan 7, 2022

The original formula is
image

However, the code implementation is reversed, see below (the sum is above)

self.d_alpha = np.sum(np.power([self.terms_counts[c] for c in self.terms_counts], self.cds_alpha))
bar.update()
self.terms_counts_cds_powered = {word: self.d_alpha / np.power(self.terms_counts[word], self.cds_alpha) for word in self.terms_counts}

I've made a pull request.

xiaoouwang added a commit to xiaoouwang/svd2vec that referenced this issue Jan 7, 2022
the cds formula seems to be reversed. See valentinp72#4
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