Comments (2)
Each of the methods has a edge_f attribute which can be used to load the graph from a file containing edges, one edge per line. That is actually pretty fast and should work for your case.
from gem.
It looks like .learn_embedding
methods with edge_f
provided call graph_util.loadGraphFromEdgeListTxt
:
Lines 145 to 160 in 79be7fd
This function constructs the complete network in-memory as a networkx object. Creating a networkx graph is the inefficient step that is slow and memory-intensive with the STRING network.
For example, node2vec.learn_embedding
ends up reading edge_f
to a networkx graph, then writing it to an edgelist. From the code below, it doesn't seem the networkx graph is actually used for anything besides rewriting the edgelist file:
Lines 58 to 65 in 5da6632
For lle.learn_embedding
, it looks like a scipy.sparse
matrix is actually what is required for computation, but that a networkx graph is loaded from the edgelist file to create the sparse matrix:
Lines 52 to 68 in 5da6632
For sdne.learn_embedding
, a sparse matrix is also used:
Lines 74 to 80 in 5da6632
I'd love access the unified API of GEM, but with support for providing an edgelist file or scipy.sparse matrix directly as input, without having this converted to a networkx graph. It seems that several of the methods actually use more efficient data structures than the networkx graph and don't need networkx features at all.
Do you have any suggestions on whether this would be possible? Even if just for one method? Currently, we've used node2vec without GEM to side-step this problem (notebook), but would love the ability to use the implementations in this package!
from gem.
Related Issues (20)
- Error in SDNE
- Tensorflow module is missing
- sdne: Nodes corresponding to embedded vectors HOT 1
- Problem with dependencies HOT 3
- LaplacianEigenmap for a large number of connected components HOT 3
- result of the running example of readme.md HOT 2
- The use of "merge" module of keras.layers in sdne.py HOT 2
- EXECUTION HOT 3
- SDNE execution problem HOT 1
- how to use GEM in an exsisting graph HOT 4
- gf not found HOT 2
- Use of Link prediction code HOT 2
- The number of positive classes for each node is leaked to TopKRanker HOT 1
- How to determine dimension variable in methods HOT 1
- [Errno 2] No such file or directory: 'gem/intermediate/karate_gf.graph' HOT 7
- SDNE implementation error HOT 3
- Error when running link prediction
- Unweighted node2vec not possible?
- Error running SDNE algorithm HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gem.