Skip to content
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

Model Wrapper for GATPredictor and AttentiveFPPredictor from DGL-LifeSci #2280

Merged
merged 31 commits into from
Nov 10, 2020
Merged

Conversation

mufeili
Copy link
Contributor

@mufeili mufeili commented Nov 4, 2020

This PR adds a model wrapper for GAT and AttentiveFP from DGL-LifeSci. The PR assumes DGL (0.5.0+) and DGL-LifeSci (0.2.5+).

As @nd-02110114 suggested in #2249 , we are replacing the previous implementation of GAT for better robustness.

I have not added the wrappers for Weave and MPNN as deprecating long-existing implementations should be carefully handled.

Once this PR is merged, we may start adding some examples for the MoleculeNet benchmark.

@rbharath @nd-02110114 @peastman This PR is complete and you may start the code review. I also need to bother you to resolve the conflicts.

Copy link
Member

@rbharath rbharath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, glad to see this make its way in! Did a first very quick pass through the PR. There appear to be some indentation issues (not technically wrong, but good to fix for code style).

For the conflict, can you try rebasing against master? You can do this roughly as follows:

git checkout master
git fetch origin
git pull
git checkout my_branch
git rebase origin/master

You can then fix the rebase conflicts manually in an editor then run the following commands

git add docs/models.rst
git rebase --continue

For the Weave/MPNN models, the Weave model is well tested and stable. The MPNN implementation isn't as good I think. If the DGL-Lifesci implementation is tested and robust, swapping out the MPNN backend (without changing any constructor settings so users won't see a difference), might be a good first test. One way to do this might be to add dc.models.pytorch_models.MPNNModel, then over the course of a release deprecate the existing implementation and swap out for the new implementation.

I'll do a more thorough review pass in a bit once @nd-02110114 and @peastman have had a chance to take a look as well

def forward(self, g):
"""Predict graph labels

Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation here might be off?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be fixed now.

self_loop: bool = True,
**kwargs):
"""
Parameters
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indentation here as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same as above.

@mufeili
Copy link
Contributor Author

mufeili commented Nov 5, 2020

For the conflict, can you try rebasing against master?

Thank you. I fixed the conflict using the commands below.

git remote add upstream https://github.com/deepchem/deepchem.git
git fetch upstream
git rebase upstream/master
git push origin master

@coveralls
Copy link

coveralls commented Nov 5, 2020

Coverage Status

Coverage increased (+2.0%) to 82.724% when pulling 9822f07 on mufeili:master into 5dbf3b0 on deepchem:master.

Copy link
Member

@nissy-dev nissy-dev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reviewed. Your PR is really good!

deepchem/feat/graph_data.py Show resolved Hide resolved
deepchem/models/torch_models/gat.py Outdated Show resolved Hide resolved
deepchem/models/torch_models/gat.py Show resolved Hide resolved
deepchem/models/torch_models/gat.py Show resolved Hide resolved
deepchem/models/torch_models/gat.py Show resolved Hide resolved
deepchem/models/torch_models/gat.py Show resolved Hide resolved
deepchem/models/torch_models/gat.py Outdated Show resolved Hide resolved
@nissy-dev
Copy link
Member

And, can you make another PR for the MPNNModel...?

@mufeili
Copy link
Contributor Author

mufeili commented Nov 7, 2020

And, can you make another PR for the MPNNModel...?

Done.

@nissy-dev
Copy link
Member

Thank you for your all fixes!
I think this PR will be ready to merge after fixing the CI error.

Copy link
Member

@rbharath rbharath left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did a pass through and this PR is looking really good! Once CI-passes, seconding @nd-02110114 that this will be ready to merge in

@mufeili
Copy link
Contributor Author

mufeili commented Nov 10, 2020

@rbharath @nd-02110114 Thank you for the help. You may go ahead to merge this PR.

It seems that the tests for WGAN and PPO still fail from time to time.

@rbharath
Copy link
Member

@mufeili Thanks for the contribution! Going to go ahead and merge in :)

@rbharath rbharath merged commit 968e521 into deepchem:master Nov 10, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants