inconsistent prediction results using HinSage
See original GitHub issuegetting inconsistent prediction results after fitting a HinSage model
I am using the HinSage-link-prediction demo script.
After model fitting, I ran model.predict(test_gen)
and got results
array([[3.9639022],
[3.1461685],
[3.5686603],
...,
[4.0026994],
[3.790706 ],
[3.9910824]], dtype=float32)
ran model.predict(test_gen)
again, this time got results
array([[4.011217 ],
[3.3255208],
[3.701041 ],
...,
[4.098828 ],
[3.6664836],
[3.870615 ]], dtype=float32)
I have also set random seeds as
import os
import tensorflow as tf
import random as python_random
seed_value= 0
np.random.seed(123)
tf.random.set_seed(1234)
python_random.seed(123)
os.environ['PYTHONHASHSEED']="3"
I am using Stellagraph 1.2.1.
Please advise how to fix this issue. Thank you!
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (2 by maintainers)
Top Results From Across the Web
Link prediction with Heterogeneous GraphSAGE (HinSAGE)
In this example, we use our generalisation of the GraphSAGE algorithm to heterogeneous graphs (which we call HinSAGE) to build a model that...
Read more >Graph-ML ~ Nicolas Racchi
My solution to the Graph Machine Learning contest offered by NECSTLab ... To be fair, the accuracy score obtained by predicting all 0's...
Read more >A weighted patient network-based framework for predicting ...
We compare the output of GNN-based models to machine learning methods by using cardiovascular disease and chronic pulmonary disease. The results ...
Read more >Privacy Preserving Survival Prediction With Graph Neural ...
4.4 HinSage/Double(G1)ModelArchitecture . ... G2 Heterogenous Graph using HinSAGE ... incredible results, mostly in the field of survival prediction.
Read more >Overview of the pipeline used for classification of population ...
Disease Prediction using Graph Convolutional Networks: Application to Autism ... HinSAGE implementation to predict cardiovascular disease event outcomes on ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I found that a possible workaround is to set batch_size to 1 in HinSAGENodeGenerator, which is used to call model.predict() method. Other seed parameters need to be set as well. The results become deterministic across different runs, however, this hurts prediction performance.
@huonw thank you for your input!
Are there ways to get node feature importance in the HinSage Link Prediction model? like the GCN
saliency_maps
.