Official implementation of "Motif-based Graph Self-Supervised Learning forMolecular Property Prediction"

Related tags

Deep Learning MGSSL
Overview

Motif-based Graph Self-Supervised Learning for Molecular Property Prediction

Official Pytorch implementation of NeurIPS'21 paper "Motif-based Graph Self-Supervised Learning for Molecular Property Prediction" (https://arxiv.org/abs/2110.00987).

Requirements

pytorch                   1.7.0             
torch-geometric           1.6.3
rdkit                     2021.03.1
tqdm                      4.31.1
tensorboardx              1.6

To install RDKit, please follow the instructions here http://www.rdkit.org/docs/Install.html

  • motif_based_pretrain/ contains codes for motif-based graph self-supervised pretraining.
  • finetune/ contains codes for finetuning on MoleculeNet benchmarks for evaluation.

Training

You can pretrain the model by

cd motif_based_pretrain
python pretrain_motif.py

Evaluation

You can evaluate the pretrained model by finetuning on downstream tasks

cd finetune
python finetune.py

Cite

If you find this repo to be useful, please cite our paper. Thank you.

@article{zhang2021motif,
  title={Motif-based Graph Self-Supervised Learning for Molecular Property Prediction},
  author={Zhang, Zaixi and Liu, Qi and Wang, Hao and Lu, Chengqiang and Lee, Chee-Kong},
  journal={arXiv preprint arXiv:2110.00987},
  year={2021}
}
You might also like...
Official implementation of our paper
Official implementation of our paper "LLA: Loss-aware Label Assignment for Dense Pedestrian Detection" in Pytorch.

LLA: Loss-aware Label Assignment for Dense Pedestrian Detection This project provides an implementation for "LLA: Loss-aware Label Assignment for Dens

Official implementation of Self-supervised Graph Attention Networks (SuperGAT), ICLR 2021.

SuperGAT Official implementation of Self-supervised Graph Attention Networks (SuperGAT). This model is presented at How to Find Your Friendly Neighbor

An official implementation of
An official implementation of "SFNet: Learning Object-aware Semantic Correspondence" (CVPR 2019, TPAMI 2020) in PyTorch.

PyTorch implementation of SFNet This is the implementation of the paper "SFNet: Learning Object-aware Semantic Correspondence". For more information,

This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.
This project is the official implementation of our accepted ICLR 2021 paper BiPointNet: Binary Neural Network for Point Clouds.

BiPointNet: Binary Neural Network for Point Clouds Created by Haotong Qin, Zhongang Cai, Mingyuan Zhang, Yifu Ding, Haiyu Zhao, Shuai Yi, Xianglong Li

Official code implementation for
Official code implementation for "Personalized Federated Learning using Hypernetworks"

Personalized Federated Learning using Hypernetworks This is an official implementation of Personalized Federated Learning using Hypernetworks paper. [

StyleGAN2 - Official TensorFlow Implementation
StyleGAN2 - Official TensorFlow Implementation

StyleGAN2 - Official TensorFlow Implementation

 Old Photo Restoration (Official PyTorch Implementation)
Old Photo Restoration (Official PyTorch Implementation)

Bringing Old Photo Back to Life (CVPR 2020 oral)

Official implementation of
Official implementation of "GS-WGAN: A Gradient-Sanitized Approach for Learning Differentially Private Generators" (NeurIPS 2020)

GS-WGAN This repository contains the implementation for GS-WGAN: A Gradient-Sanitized Approach for Learning Differentially Private Generators (NeurIPS

Official PyTorch implementation of Spatial Dependency Networks.
Official PyTorch implementation of Spatial Dependency Networks.

Spatial Dependency Networks: Neural Layers for Improved Generative Image Modeling Đorđe Miladinović   Aleksandar Stanić   Stefan Bauer   Jürgen Schmid

Comments
  • [error] rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol.

    [error] rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol.

    Hello! I'm trying to run mol_tree.py, but I'm getting KekulizeException: error. Is it a problem about rdkit version? Below are my rdkit version and console output.

    rdkit=2021.09.2=py37h13c2175_0

    runfile('/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py', wdir='/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util') Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53) Type 'copyright', 'credits' or 'license' for more information IPython 7.30.1 -- An enhanced Interactive Python. Type '?' for help. PyDev console: using IPython 7.30.1 Python 3.7.12 | packaged by conda-forge | (default, Oct 26 2021, 06:08:53) [GCC 9.4.0] on linux start CC(C)(C)c1ccc2occ(CC(=O)Nc3ccccc3F)c2c1 C[C@@H]1CC(Nc2cncc(-c3nncn3C)c2)CC@@HC1 N#Cc1ccc(-c2ccc(OC@@Hc3ccccc3)cc2)cc1 CCOC(=O)[C@@H]1CCCN(C(=O)c2nc(-c3ccc(C)cc3)n3c2CCCCC3)C1 N#CC1=C(SCC(=O)Nc2cccc(Cl)c2)N=C([O-])C@HC12CCCCC2 CCNH+C@(CC)C@Hc1cscc1Br COc1ccc(C(=O)N(C)C@@HC/C(N)=N/O)cc1O O=C(Nc1nc[nH]n1)c1cccnc1Nc1cccc(F)c1 Cc1c(/C=N/c2cc(Br)ccn2)c(O)n2c(nc3ccccc32)c1C#N Traceback (most recent call last): File "/home/bionuser/.conda/envs/bionlab/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3457, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "", line 1, in runfile('/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py', wdir='/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util') File "/home/bionuser/.pycharm_helpers/pydev/_pydev_bundle/pydev_umd.py", line 198, in runfile pydev_imports.execfile(filename, global_vars, local_vars) # execute the script File "/home/bionuser/.pycharm_helpers/pydev/_pydev_imps/_pydev_execfile.py", line 18, in execfile exec(compile(contents+"\n", file, 'exec'), glob, loc) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py", line 149, in mol = MolTree(line) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/mol_tree.py", line 105, in init cmol = get_clique_mol(self.mol, c) File "/home/bionuser/bionlab/bionlab/contrib/seyong/tasks/tmp/MGSSL/motif_based_pretrain/util/chemutils.py", line 80, in get_clique_mol smiles = Chem.MolFragmentToSmiles(mol, atoms, kekuleSmiles=True) rdkit.Chem.rdchem.KekulizeException: Can't kekulize mol. Unkekulized atoms: 1 2 12 15 23

    Thank you!

    opened by rest1h 1
  • Questions about motifs

    Questions about motifs

    Hi, I wonder if there are ovelapping atoms between motifs in one molecule? I run the following script

    from moltree import MolTree
    smiles = "O=C1[C@@H]2C=C[C@@H](C=CC2)C1(c1ccccc1)c1ccccc1"
    mol = MolTree(smiles)
    atom_count = 0
    for c in mol.nodes:
        atom_count += c.mol.GetNumAtoms()
        print(c.mol.GetNumAtoms())
        print(c.clique)
    print(f"atoms in original mol: {mol.mol.GetNumAtoms()}, atoms in motifs: {atom_count}")
    

    And the output is:

    2
    [0, 1]
    2
    [9, 10]
    2
    [9, 16]
    9
    [1, 2, 3, 4, 5, 6, 7, 8, 9]
    6
    [11, 12, 13, 14, 15, 10]
    6
    [17, 18, 19, 20, 21, 16]
    1
    [9]
    atoms in original mol: 22, atoms in motifs: 28
    
    opened by toooooodo 1
  • Where is the atom loss and bond loss?

    Where is the atom loss and bond loss?

    Dear author, in the paper the final loss is the sum of atom, bond and motif. I cannot find the loss of atom and bond in the source code. So what is the final loss function of MGSSL?

    opened by windyLemon 0
  • Are there some mistakes in tree decomposition modules?

    Are there some mistakes in tree decomposition modules?

    Dear author, I run the mol_tree.py to preprocess the dataset and generate clique.txt, but it throws the KekulizeException for molecules such as Cc1c(/C=C/c2cc(Br)ccn2)c(O)n2c(nc3ccccc32)c1C#N. I use the decomposition modules on other datsets, it make the same exceptions, can you update the code or give some advice?

    opened by 1004766790 1
Owner
zaixi
I am Zaixi Zhang from USTC
zaixi
Official implementation of AAAI-21 paper "Label Confusion Learning to Enhance Text Classification Models"

Description: This is the official implementation of our AAAI-21 accepted paper Label Confusion Learning to Enhance Text Classification Models. The str

null 101 Nov 25, 2022
Official PyTorch implementation for paper Context Matters: Graph-based Self-supervised Representation Learning for Medical Images

Context Matters: Graph-based Self-supervised Representation Learning for Medical Images Official PyTorch implementation for paper Context Matters: Gra

null 49 Nov 23, 2022
The official implementation of NeMo: Neural Mesh Models of Contrastive Features for Robust 3D Pose Estimation [ICLR-2021]. https://arxiv.org/pdf/2101.12378.pdf

NeMo: Neural Mesh Models of Contrastive Features for Robust 3D Pose Estimation [ICLR-2021] Release Notes The offical PyTorch implementation of NeMo, p

Angtian Wang 76 Nov 23, 2022
StyleGAN2-ADA - Official PyTorch implementation

Abstract: Training generative adversarial networks (GAN) using too little data typically leads to discriminator overfitting, causing training to diverge. We propose an adaptive discriminator augmentation mechanism that significantly stabilizes training in limited data regimes.

NVIDIA Research Projects 3.2k Dec 30, 2022
Official implementation of the ICLR 2021 paper

You Only Need Adversarial Supervision for Semantic Image Synthesis Official PyTorch implementation of the ICLR 2021 paper "You Only Need Adversarial S

Bosch Research 272 Dec 28, 2022
Official PyTorch implementation of Joint Object Detection and Multi-Object Tracking with Graph Neural Networks

This is the official PyTorch implementation of our paper: "Joint Object Detection and Multi-Object Tracking with Graph Neural Networks". Our project website and video demos are here.

Richard Wang 443 Dec 6, 2022
Official implementation of the paper Image Generators with Conditionally-Independent Pixel Synthesis https://arxiv.org/abs/2011.13775

CIPS -- Official Pytorch Implementation of the paper Image Generators with Conditionally-Independent Pixel Synthesis Requirements pip install -r requi

Multimodal Lab @ Samsung AI Center Moscow 201 Dec 21, 2022
Official pytorch implementation of paper "Image-to-image Translation via Hierarchical Style Disentanglement".

HiSD: Image-to-image Translation via Hierarchical Style Disentanglement Official pytorch implementation of paper "Image-to-image Translation

null 364 Dec 14, 2022
Official pytorch implementation of paper "Inception Convolution with Efficient Dilation Search" (CVPR 2021 Oral).

IC-Conv This repository is an official implementation of the paper Inception Convolution with Efficient Dilation Search. Getting Started Download Imag

Jie Liu 111 Dec 31, 2022
Official PyTorch Implementation of Unsupervised Learning of Scene Flow Estimation Fusing with Local Rigidity

UnRigidFlow This is the official PyTorch implementation of UnRigidFlow (IJCAI2019). Here are two sample results (~10MB gif for each) of our unsupervis

Liang Liu 28 Nov 16, 2022