Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
OpenDAS
dgl
Commits
400687d7
Unverified
Commit
400687d7
authored
Jan 08, 2021
by
Pein
Committed by
GitHub
Jan 08, 2021
Browse files
add venue label filename; delete redundant code (#2491)
Co-authored-by:
Quan (Andy) Gan
<
coin2028@hotmail.com
>
parent
bdb88df5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
4 deletions
+2
-4
examples/pytorch/metapath2vec/test.py
examples/pytorch/metapath2vec/test.py
+2
-4
No files found.
examples/pytorch/metapath2vec/test.py
View file @
400687d7
...
@@ -9,6 +9,7 @@ if __name__ == "__main__":
...
@@ -9,6 +9,7 @@ if __name__ == "__main__":
experiment_times
=
1
experiment_times
=
1
percent
=
0.05
percent
=
0.05
file
=
open
(
".../output_file_path/..."
)
file
=
open
(
".../output_file_path/..."
)
file_1
=
open
(
".../label 2/googlescholar.8area.venue.label.txt"
)
file_2
=
open
(
".../label 2/googlescholar.8area.author.label.txt"
)
file_2
=
open
(
".../label 2/googlescholar.8area.author.label.txt"
)
check_venue
=
{}
check_venue
=
{}
check_author
=
{}
check_author
=
{}
...
@@ -58,16 +59,13 @@ if __name__ == "__main__":
...
@@ -58,16 +59,13 @@ if __name__ == "__main__":
count
=
0
count
=
0
for
author
in
authors
:
for
author
in
authors
:
count
+=
1
count
+=
1
print
(
"one more author "
+
str
(
count
))
#
print("one more author " + str(count))
temp_1
=
np
.
array
(
author_embed_dict
[
author
])
temp_1
=
np
.
array
(
author_embed_dict
[
author
])
if
len
(
author_embedding
)
==
0
:
if
len
(
author_embedding
)
==
0
:
author_embedding
=
temp_1
author_embedding
=
temp_1
else
:
else
:
author_embedding
=
np
.
vstack
((
author_embedding
,
temp_1
))
author_embedding
=
np
.
vstack
((
author_embedding
,
temp_1
))
# split data into training and testing
# split data into training and testing
author_split
=
int
(
author_count
*
0.8
)
author_training
=
author_embedding
[:
author_split
+
1
,:]
author_testing
=
author_embedding
[
author_split
+
1
:,:]
print
(
"splitting"
)
print
(
"splitting"
)
venue_split
=
int
(
venue_count
*
percent
)
venue_split
=
int
(
venue_count
*
percent
)
venue_training
=
venue_embedding
[:
venue_split
,:]
venue_training
=
venue_embedding
[:
venue_split
,:]
...
...
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