question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

inconsistent prediction results using HinSage

See original GitHub issue

getting 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:open
  • Created 2 years ago
  • Comments:6 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
mikhail247commented, Apr 22, 2021

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.

0reactions
enjielicommented, Apr 6, 2021

@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 .

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found