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

python wrapper - Cost for each sample #74

Open
skeld opened this issue Jul 3, 2018 · 0 comments
Open

python wrapper - Cost for each sample #74

skeld opened this issue Jul 3, 2018 · 0 comments

Comments

@skeld
Copy link

skeld commented Jul 3, 2018

Hello,
I'm working with the python wrapper bhtsne.py, the iris dataset, and on a ubuntu 14.04.
I'm trying to get the costs for each samples (as specified iat the end of bh_tsne()).

I de-commented the last line (of the function)

#read_unpack('{}d'.format(sample_count), output_file)

and adapted it

_read_unpack('{}d'.format(len(results)), output_file)

and put it before the yield, inside a simple print()

However, all the cost are equal to zero. Even when i set a very low number of iterations, and the verbose tell me that the error is still high:

$ ./bhtsne.py -d 2 -p 30 -v -i iris_data.txt -o tsne_test.output --no_pca -m 100
Read the 150 x 4 data matrix successfully!
Using current time as random seed...
Using no_dims = 2, perplexity = 30.000000, and theta = 0.500000
Computing input similarities...
Building tree...
 - point 0 of 150
Input similarities computed in 0.01 seconds (sparsity = 0.706622)!
Learning embedding...
Iteration 50: error is 45.556438 (50 iterations in 0.02 seconds)
Iteration 99: error is 44.807590 (50 iterations in 0.02 seconds)
Fitting performed in 0.04 seconds.
Wrote the 150 x 2 data matrix successfully!
('costs: ', (0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, [... all 0.0 ..], 0.0, 0.0))

What did i missed' or how can i get the costs ?

Thanks

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