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

kmeans gives wrong counts #40

Open
sunshineatnoon opened this issue Sep 14, 2016 · 1 comment
Open

kmeans gives wrong counts #40

sunshineatnoon opened this issue Sep 14, 2016 · 1 comment

Comments

@sunshineatnoon
Copy link

sunshineatnoon commented Sep 14, 2016

I have a tensor with dimension: 204x4096 where 204 is the number of samples while 4096 is feature dimension. After 10000 iterations of clustering by kmeans, it returns a counts like this: [1919809, 60009, 60013, 0, 169]. This is definitely wrong since I only have 204 samples. The screen shot is below:

And here is my code, could anyone please tell where I did wrong?

grams = torch.load('grams.t7')
grams = grams:double()

centroids, counts = unsup.kmeans(grams, 5, 10000, nil, nil, true)
@Conchylicultor
Copy link

Yes, I had some pb too with the kmean implementation. I you look at the code, they try to accumulate the count values accross the iterations. Don't really understand why.
https://github.com/koraykv/unsup/blob/master/kmeans.lua#L94

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