Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
Fize Jacques
GMatch4py
Commits
c4667d6f
Commit
c4667d6f
authored
Mar 04, 2019
by
Fize Jacques
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add Parralelization graph embedding
parent
a0519606
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
gmatch4py/embedding/deepwalk.pyx
gmatch4py/embedding/deepwalk.pyx
+1
-1
gmatch4py/embedding/graph2vec.pyx
gmatch4py/embedding/graph2vec.pyx
+1
-1
No files found.
gmatch4py/embedding/deepwalk.pyx
View file @
c4667d6f
...
...
@@ -116,7 +116,7 @@ cdef class DeepWalk(Base):
def
extract_embedding
(
self
,
listgs
):
from
tqdm
import
tqdm
models
=
[
process
(
nx
.
Graph
(
g
))
for
g
in
tqdm
(
listgs
,
desc
=
"Extracting Embeddings..."
)
]
models
=
Parallel
(
n_jobs
=
cpu_count
())(
delayed
(
process
)
(
nx
.
Graph
(
g
))
for
g
in
tqdm
(
listgs
,
desc
=
"Extracting Embeddings..."
)
)
return
models
@
cython
.
boundscheck
(
False
)
...
...
gmatch4py/embedding/graph2vec.pyx
View file @
c4667d6f
...
...
@@ -89,7 +89,7 @@ def generate_model(graphs, iteration = 2, dimensions = 64, min_count = 5, down_s
Main function to read the graph list, extract features, learn the embedding and save it.
:param args: Object with the arguments.
"""
document_collections
=
[
feature_extractor
(
g
,
ix
,
iteration
)
for
ix
,
g
in
tqdm
(
enumerate
(
graphs
),
desc
=
"Extracting Features..."
)
]
document_collections
=
Parallel
(
n_jobs
=
workers
)(
delayed
(
feature_extractor
)
(
g
,
ix
,
iteration
)
for
ix
,
g
in
tqdm
(
enumerate
(
graphs
),
desc
=
"Extracting Features..."
)
)
graphs
=
[
nx
.
relabel_nodes
(
g
,{
node
:
str
(
node
)
for
node
in
list
(
g
.
nodes
)},
copy
=
True
)
for
g
in
graphs
]
model
=
Doc2Vec
(
document_collections
,
vector_size
=
dimensions
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment