Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
L
linkprediction_depo
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jacques Fize
linkprediction_depo
Commits
ac750057
Commit
ac750057
authored
4 years ago
by
Fize Jacques
Browse files
Options
Downloads
Patches
Plain Diff
Add args to generate_theoric_random_graph.py
parent
2240661f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
generate_theoric_random_graph.py
+14
-6
14 additions, 6 deletions
generate_theoric_random_graph.py
with
14 additions
and
6 deletions
generate_theoric_random_graph.py
+
14
−
6
View file @
ac750057
# coding = utf-8
import
os
import
networkx
as
nx
import
argparse
...
...
@@ -9,6 +9,11 @@ import random
import
copy
from
tqdm
import
tqdm
# COMMAND PARSING
parser
=
argparse
.
ArgumentParser
()
parser
.
add_argument
(
"
output_dir
"
)
args
=
parser
.
parse_args
()
def
generate_sbm_prob_matrix
(
nb_of_blocks
,
prob_btw_block
=
0.1
):
M
=
np
.
zeros
((
nb_of_blocks
,
nb_of_blocks
))
np
.
fill_diagonal
(
M
,[
random
.
random
()
for
i
in
range
(
nb_of_blocks
)])
...
...
@@ -19,8 +24,11 @@ def generate_sbm_prob_matrix(nb_of_blocks,prob_btw_block=0.1):
M
[
j
,
i
]
=
prob_btw_block
return
M
GRAPH_SIZE
=
[
50
,
75
,
100
]
OUTPUT_DIR
=
"
data/theoric_graph_1/
"
OUTPUT_DIR
=
args
.
output_dir
if
os
.
path
.
exist
(
OUTPUT_DIR
):
raise
FileExistsError
(
"
Output directory does not exists !
"
)
parameters
=
{
"
planted_partition_graph
"
:
{
...
...
@@ -35,7 +43,7 @@ parameters = {
},
"
fast_gnp_random_graph
"
:
{
"
n
"
:
GRAPH_SIZE
,
"
p
"
:
[
0.1
,
0.4
,
0.6
,
0.8
]
"
p
"
:
[
0.1
,
0.4
,
0.6
]
},
"
random_powerlaw_tree_sequence
"
:
{
# configuration_model
"
n
"
:
GRAPH_SIZE
,
...
...
@@ -43,12 +51,12 @@ parameters = {
},
"
random_geometric_graph
"
:
{
"
n
"
:
GRAPH_SIZE
,
"
radius
"
:
[
0.1
,
0.
2
,
0.
4
,
0.
8
]
"
radius
"
:
[
0.1
,
0.4
,
0.
6
]
},
"
waxman_graph
"
:
{
"
n
"
:
GRAPH_SIZE
,
"
beta
"
:
[
0.1
,
0.4
,
0.
8
],
"
alpha
"
:
[
0.1
,
0.4
,
0.
8
]
"
beta
"
:
[
0.1
,
0.4
,
0.
6
],
"
alpha
"
:
[
0.1
,
0.4
,
0.
6
]
},
"
geographical_threshold_graph
"
:
{
"
n
"
:
GRAPH_SIZE
,
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment