-
Notifications
You must be signed in to change notification settings - Fork 132
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
Support GCN #89
Support GCN #89
Conversation
Thank you very much for the PR! This is question so far.
|
Thank you for your feedback! Re 1., I'm sorry for that I forgot to remove them. They are not used now. will remove them. Re 2., I have the same opinion that the name of "GCN" is too general, though the authors calls it just "GCN" in the paper. I once thought that "LBM" might be a good name for it because there is a paper (link) that classifies this model as one of "Laplacian Based Methods". However, "LBM" is bit confusing to me, mainly because "LBM" means "Lattice Boltzmann Method" to me... Anyway, I'm fine with using different name. |
Codecov Report
@@ Coverage Diff @@
## master #89 +/- ##
=========================================
+ Coverage 68.35% 69.16% +0.8%
=========================================
Files 58 61 +3
Lines 2067 2296 +229
=========================================
+ Hits 1413 1588 +175
- Misses 654 708 +54 |
Re 2., I'm currently considering to use the name "Spectral"GraphConvolution for this. Let us consider naming issue with other members as well. |
chainer_chemistry/models/gcn.py
Outdated
h = functions.softmax(h, axis=2) # softmax along channel axis | ||
y = functions.sum(h, axis=1) # sum along node axis | ||
return y | ||
|
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.
Original paper does not define "Readout" (get feature of "whole graph"), instead, their output is for each node by simply taking softmax only.
So, output_weight
and sum
is added by you to extract "graph feature"?
Is my understanding correct?
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.
Yes. To be more precise, I had no idea what to do with readout, so I used the NFP's readout implementation.
chainer_chemistry/models/gcn.py
Outdated
for i, (gconv, bnorm) in enumerate(zip(self.gconvs, | ||
self.bnorms)): | ||
h = gconv(h, w_adj) | ||
h = bnorm(h) |
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 referred pytorch implementation by author.
https://github.com/tkipf/pygcn/blob/master/pygcn/models.py#L14
batch norm is originally not used, so is it added by you?
If so, can you add an option in __init__
kwargs to use/not use batch normalization?
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.
OK, will add an option to select whether to use bath normalization or not.
examples/tox21/run_gcn.sh
Outdated
@@ -0,0 +1,32 @@ | |||
#!/bin/bash -x |
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.
Is this file necessary?
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.
No... I thought I removed it...
examples/tox21/train_tox21.py
Outdated
@@ -36,6 +36,8 @@ | |||
import data | |||
import predictor | |||
|
|||
import numpy |
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.
Is this line necessary? seems numpy is not used in change.
I read the paper, https://arxiv.org/pdf/1609.02907.pdf Re 2.,
and in Table 3, they finally adopt Renormalized version of the Eq (8). So in my opinion this is "Renormalized First order Spectral Graph Convolutional Network". |
I noticed we can add these implementation as well, So these items can be raised as issue, and merge this PR first.
|
Regarding the naming issue. I would suggest how others call the method. For example:
If there isn't. We might need to coin some word. |
As far as I know, there are several graph-conv methods which uses Laplacian matrix formulation. [1]. 'Convolutional Neural Networks on Graphs with Fast Localized Spectral Filtering' https://arxiv.org/abs/1606.09375 [2]. This PR. SEMI-SUPERVISED CLASSIFICATION WITH GRAPH CONVOLUTIONAL NETWORKS And these are usually referred as grouped way, e.g., That is why I suggested |
Thank you for your feedback! I've fixed the branch based on your suggestion. Please check again!
|
Thank you for fix. I'd like to merge it after following discussion.
I also briefly checked deepchem, molecule.ai but I could not find any existing naming for this.
|
Thank you for your feedback, @corochann ! I'm not particular about readout, so I added |
Regarding the naming issue, I looked up several papers that refer the original paper and how they call their method. (1) Papers that only refer the original paper and do not name the algorithm: URL, URL. As we expect, it seems that there are no de-facto standard of the name except GCN and that GCN can be also used in more general meaning. Therefore, I agree with putting |
@anaruse Finally, could you change the name from After above change, I would like to test the model performance to see if training progresses in my environment and merge it. |
I've changed the name from GCN to RSGCN and added some docs. Please review again! |
Thank you for the change, LGTM. When I test the model performance with ROC AUC Evaluator (#62), I found the following.
It is ok for me to send above PR 1 & 2 by myself after merge this PR at first. Is it ok for you? |
Thank you for your approval! Regarding change 1. and 2., I'm fine with those changes. Thanks. |
This PR aims to add a GCN model and support batch normalization for graph convolution. Regarding GCN model, please refer to https://arxiv.org/abs/1609.02907, though the GCN model in this branch is bit different from the model in the paper. I also modified example of tox21, so that you can test the GCN model with tox21 dataset.