-
Notifications
You must be signed in to change notification settings - Fork 425
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
Make cluster gcn reproducible #937
base: develop
Are you sure you want to change the base?
Conversation
""" | ||
|
||
def __init__(self, G, clusters=1, q=1, lam=0.1, name=None): | ||
def __init__(self, G, clusters=1, q=1, lam=0.1, name=None, seed=None): |
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.
Refactor this function to reduce its Cognitive Complexity from 17 to the 15 allowed.
Code Climate has analyzed commit d078921 and detected 0 issues on this pull request. View more on Code Climate. |
Codecov Report
@@ Coverage Diff @@
## develop #937 +/- ##
=========================================
+ Coverage 83.9% 84.3% +0.4%
=========================================
Files 53 53
Lines 5101 5103 +2
=========================================
+ Hits 4281 4301 +20
+ Misses 820 802 -18
Continue to review full report at Codecov.
|
Codecov Report
@@ Coverage Diff @@
## develop #937 +/- ##
=========================================
+ Coverage 84.3% 84.8% +0.5%
=========================================
Files 53 58 +5
Lines 5103 4958 -145
=========================================
- Hits 4301 4206 -95
+ Misses 802 752 -50
Continue to review full report at Codecov.
|
targets = np.random.rand(petersen_graph.number_of_nodes(), target_size) | ||
assert_reproducible( | ||
lambda: cluster_gcn_nai(petersen_graph, targets, 4, 2, shuffle=shuffle) | ||
) |
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.
I feel that we need a test to also make sure that if the seed is different, then the models are indeed different. Otherwise, we have not established a causal link between the random seed value and initial model weights.
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.
Hi @kjun9
You might want to have a look at my suggestion for another test, otherwise this is good to merge.
P.
This updates cluster gcn's node generator to use the
random_state
utility that's now available, and adds some tests to make sure the model is reproducible when we set the global stellargraph seed.Part of #749