GithubHelp home page GithubHelp logo

aida-ugent / csne Goto Github PK

View Code? Open in Web Editor NEW
4.0 3.0 2.0 56 KB

Source code for CSNE: Conditional Signed Network Embeddings (CIKM2020)

Home Page: https://dl.acm.org/doi/10.1145/3340531.3411959

License: Other

Python 100.00%
graph-embedding network-embedding maxent sign-prediction paper graphs graph-algorithms representation-learning

csne's People

Contributors

cthoyt avatar dru-mara avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

csne's Issues

Compatibility with python 3.7+

Python 2.7 is way past end-of-life and Python 3.6 will be at end of life at the end of the year. Are there specific reasons why you pinned the repository to older versions of python as well as pretty old versions of its dependencies?

It says on the README now that the code is extensively tested but I'm not really sure what this means without having something like unittests that can be run programatically. If testing were possible programatically, you could show that it's compatible with more modern versions of python and the dependent libraries

Search for alpha results in overflow error

I'm getting an overflow error when fitting the prior because of v = np.exp(v). Exact output:

[iter 0] Gradient norm: 5491631.49                                                                                                     
[iter 0] Objective: 1321041.74                                                                                                         
[iter 1] Gradient norm: 9906547.80                                                                                                     
[iter 1] Objective: 1285034.30                                                                                                         
Fitting prior:  20%|████████████████▊                                                                   | 2/10 [00:00<00:03,  2.44it/s]
/Users/cthoyt/dev/CSNE/src/csne/maxent_comb.py:191: RuntimeWarning: overflow encountered in exp
  v = np.exp(v)
[iter 2] Gradient norm: 10061996.41                                                                                                    
[iter 2] Objective: 1284818.77                                                                                                         
[iter 3] Gradient norm: 10061021.36                                                                                                    
[iter 3] Objective: 1284812.61                                                                                                         
[iter 4] Gradient norm: 10060726.78                                                                                                    
[iter 4] Objective: 1284806.45                                                                                                         
[iter 5] Gradient norm: 10060432.22                                                                                                    
[iter 5] Objective: 1284800.29                                                                                                         
[iter 6] Gradient norm: 10060137.66                                                                                                    
[iter 6] Objective: 1284794.13                                                                                                         
[iter 7] Gradient norm: 10059843.11                                                                                                    
[iter 7] Objective: 1284787.98                                                                                                         
[iter 8] Gradient norm: 10059548.56                                                                                                    
[iter 8] Objective: 1284781.82                                                                                                         
[iter 9] Gradient norm: 10059254.03                                                                                                    
[iter 9] Objective: 1284775.66  

It's happening in this code:

while True:
x_test = x - alpha * delta
v = x_test[r_idx] + x_test[c_idx]
for fi in range(self.__nfuncs):
v += self.__F[fi].maskdF * x_test[self.__2n + fi]
v = np.exp(v)
obj_test = np.sum(np.log(1 + v)) - np.dot(x_test, self.__cs)
if obj_test <= obj - (alpha * imp):
x = x_test
aux = v
obj = obj_test
break
alpha = alpha / 2.0

Any ideas? If you look at the norms, they jump up to being much higher after this error. Maybe this math should be done in log space? Or alternatively, perhaps these numbers are nonsensically high and everything should be normed.

Make pip installable

Thanks for the nice package and paper - it would be much more useful if it were pip installable. Would you be willing to accept a PR to enable this?

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.