GithubHelp home page GithubHelp logo

alexgrinch / ro_sgns Goto Github PK

View Code? Open in Web Editor NEW
19.0 19.0 8.0 3.74 MB

Implementation of Riemannian optimization for skip-gram negative sampling (ACL 2017)

License: MIT License

Jupyter Notebook 15.96% Python 77.42% Perl 6.62%

ro_sgns's People

Contributors

alexgrinch avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

ro_sgns's Issues

SGD-SGNS

Dear Alex

Is the method SGD-SGNS included in the repo?

If not, may I know which implementation you used for experiment?

Thanks,
Matt

Data issue

In enwik_experiments.ipynb, the data data/enwik/enwik9.txt seems to be needed. Could you please provide this data in the repo?

Thanks,
Matt

Corr Test

Dear Alex

I am trying to run the correlation test.

Based on your datasets_corr function in functions.py, I am doing something as follows

opt_experiment(model_enwik,
               mode='PS', 
               d=100,
               eta = 5e-5, # step size
               MAX_ITER=7,
               from_iter=0,
               start_from='SVD',
               init=(True, C_svd, W_svd))

from scipy.spatial.distance import cosine
from scipy.stats import spearmanr

datasets_path = ".\datasets"
indices = np.load(open(datasets_path+'/indices.npz', 'rb'))
name = 'wordsim_sim'

pairs_num = indices['0'+name].size
idx = np.arange(pairs_num)
        
ind1 = indices['0'+name][idx]
ind2 = indices['1'+name][idx]
scores = indices['2'+name][idx]

W, C = model_enwik.W, model_enwik.C
G = W
G = G / np.linalg.norm(G, axis=0)
cosines = (G[:,ind1]*G[:,ind2]).sum(axis=0)
spearmanr(cosines, scores)[0]```

The code works find, but the result is -0.11981128713175491, which I expect to be 0.729 in the paper. I am pretty sure I misunderstand something and code something wrong.

Could you please help to take a look at what is going wrong?


Thanks,
Matt

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.