LFhase / CIGA

[NeurIPS 2022] Learning Causally Invariant Representations for Out-of-Distribution Generalization on Graphs
https://arxiv.org/abs/2202.05441
MIT License
97 stars 10 forks source link

Why use kmeans_predict in GALA? #4

Closed sh-qiangchen closed 1 week ago

sh-qiangchen commented 1 month ago

Hi, thanks for sharing the code.

I noticed that you used kmeans_predict() to predict cluster ids. reg

In my understanding, we don't need to know the labels of the environment in contrast loss when selecting positive and negative samples.

LFhase commented 1 month ago

Hi @sh-qiangchen , thanks for your careful checking. It's for the baseline of GIL, not for CIGA : )

sh-qiangchen commented 1 week ago

Hi @LFhase , thanks for your reply! In line 739-768 of the GALA code main.py, you use EA model to predict label of environment, not labels for the graph. Please check whether my understanding is correct. Additionally, The usage of argmax in line 758 of main.py for loss, won't it be non-differentiability if we don't use the re-parameteration trick?

Thanks again for the perfect project!

LFhase commented 1 week ago

Hi @LFhase , thanks for your reply! In line 739-768 of the GALA code main.py, you use EA model to predict label of environment, not labels for the graph. Please check whether my understanding is correct. Additionally, The usage of argmax in line 758 of main.py for loss, won't it be non-differentiability if we don't use the re-parameteration trick?

Thanks again for the perfect project!

Hi @sh-qiangchen , thank you for your further interest in our follow-up work GALA. Indeed, it is an alternative implementation to provide the labels of the graph, as the representations used for clustering are based on the input of the whole graph. Since the EA labels are just to provide some partitions of the training set from a fixed EA model, it does not need the gradient backpropagation. Please let me know if you have any further questions. Thanks.

sh-qiangchen commented 1 week ago

Hi @LFhase , thanks for your reply! In line 739-768 of the GALA code main.py, you use EA model to predict label of environment, not labels for the graph. Please check whether my understanding is correct. Additionally, The usage of argmax in line 758 of main.py for loss, won't it be non-differentiability if we don't use the re-parameteration trick? Thanks again for the perfect project!

Hi @sh-qiangchen , thank you for your further interest in our follow-up work GALA. Indeed, it is an alternative implementation to provide the labels of the graph, as the representations used for clustering are based on the input of the whole graph. Since the EA labels are just to provide some partitions of the training set from a fixed EA model, it does not need the gradient backpropagation. Please let me know if you have any further questions. Thanks.

Thanks, i see