-
-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New Engine: Stochastic Block Model (sbm
)
#189
base: dev
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sadrasabouri Thanks for your efforts 💯
I believe that obtaining probability_matrix
and block_sizes
directly via the CLI is not advisable due to size issue! Instead, we can prompt the user for parameters such as intra_probability
, inter_probability
, and number_of_blocks
. Based on these inputs, we can generate the probability_matrix
and block_sizes
, restricting custom edits to the config mode.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## dev #189 +/- ##
==========================================
- Coverage 98.33% 96.87% -1.46%
==========================================
Files 4 8 +4
Lines 419 637 +218
Branches 68 91 +23
==========================================
+ Hits 412 617 +205
- Misses 4 15 +11
- Partials 3 5 +2 ☔ View full report in Codecov by Sentry. |
Hey @sepandhaghighi, I applied the changes. This PR needed an immediate post-merge PR which takes into consideration the following points:
{
"file_name": "asd",
"number_of_files": 1,
"vertices": 10,
"max_weight": 1,
"min_weight": 1,
"min_edge": 0,
"max_edge": 0,
"edge_number": 0,
"sign": true,
"output_format": "JSON",
"weight": true,
"engine": "sbm",
"direct": false,
"self_loop": false,
"multigraph": false,
"config": true,
"probability": 0.5,
"blocks": 3,
"inter_probability": 0.1,
"intra_probability": 0.8,
"block_sizes": [
3,
3,
4
],
"probability_matrix": [
[
0.9,
0,
0
],
[
0,
0.9,
0
],
[
0,
0,
0.9
]
],
"pyrgg_version": "1.6"
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sadrasabouri Thanks for your efforts 💯
I believe we can eliminate self_loop
and direct
from the inputs. These parameters can both be managed through the probability_matrix
.
pyrgg/params.py
Outdated
@@ -142,6 +154,10 @@ | |||
|
|||
PYRGG_CONFIG_SAVE_ERROR_MESSAGE = "[Error] Failed to save config file!" | |||
|
|||
PYRGG_UNDIVISIBLE_WARNING_MESSAGE = "Warning : Vertices are not divisible by blocks. The last block will have the remaining vertices." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Warning] Vertices ...
pyrgg/params.py
Outdated
@@ -142,6 +154,10 @@ | |||
|
|||
PYRGG_CONFIG_SAVE_ERROR_MESSAGE = "[Error] Failed to save config file!" | |||
|
|||
PYRGG_UNDIVISIBLE_WARNING_MESSAGE = "Warning : Vertices are not divisible by blocks. The last block will have the remaining vertices." | |||
|
|||
PYRGG_SBM_WARNING_MESSAGE = "[Warning] - In CLI mode, Stochastic Block Model gets the number of blocks and inter/intra probabilities. To get more detailed configuration, please save and edit the config file." |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Remove
In CLI mode,
[Warning] Stochastic ...
I agree with removing |
What does this implement/fix? Explain your changes.
This PR added a new engine: stochastic block model.${C_1, C_2, \cdots, C_k}$ , then a matrix $P_{k \times k}$ would assign the probability of existence of an edge between $v_i$ and $v_j$ with probability $P_{ij}$ .
This generation model partitions
n
vertices intok
set:Also some minor edits for prior engines have been applied.
Any other comments?
Two points that need to be clarified:
block_sizes
andprobability_matrix
. Let me know what we should do.self-loop
for this engine but we should note that the probability of self-loop is