Coder Social home page Coder Social logo

tencent-alchemy / alchemy Goto Github PK

View Code? Open in Web Editor NEW
113.0 13.0 38.0 56 KB

Home Page: https://alchemy.tencent.com/

License: MIT License

Python 99.72% Shell 0.28%
quantum-chemistry graph-neural-networks machine-learning deep-learning graph-representation-learning mpnn-model

alchemy's Introduction

Alchemy

Here is the repo for Tencent Alchemy Tools. We currently provide a PyG dataloader for Alchemy contest, as well as a PyG mpnn model.

HOWTO

How to use deep graph lib (dgl) dataloader for Alchemy

How to download Alchemy dataset

Simply run python3 train.py, the script will download and preprocess the dataset (dev set) automatically. You can download other dataset (valid set & test set) in a similar way or just do it manually.

How to run dgl based models

SchNet: expected MAE 0.065

python train.py --model sch --epochs 250

MGCN: expected MAE 0.050

python train.py --model mgcn --epochs 250

With Tesla V100, SchNet takes 80s/epoch and MGCN takes 110s/epoch.

Dependencies

  • PyTorch 1.0+
  • dgl 0.3+
  • RDKit

Reference

  • K.T. Schütt. P.-J. Kindermans, H. E. Sauceda, S. Chmiela, A. Tkatchenko, K.-R. Müller. SchNet: A continuous-filter convolutional neural network for modeling quantum interactions. Advances in Neural Information Processing Systems 30, pp. 992-1002 (2017) link
  • C. Lu, Q. Liu, C. Wang, Z. Huang, P. Lin, L. He, Molecular Property Prediction: A Multilevel Quantum Interactions Modeling Perspective. The 33rd AAAI Conference on Artificial Intelligence (2019) link

How to use pytorch-geometric (PyG) dataloader for Alchemy

Environment setup

You need to install some packages before you can run the code. First you will need to install the Anaconda Distribution. Then you need to run the following commands to setup a anaconda environment and install the required libraries.

conda env create -f environment.yml

conda activate Alchemy

pip install -r requirements.txt

How to download Alchemy dataset

You may want to use the script at pyg/data-bin/download.sh. This script downloads dev.zip and valid.zip and extracts them at pyg/data-bin/raw.

You can also download manually from the homepage of Alchemy contest.

How to run PyG mpnn model

If you download Alchemy dataset and extract at pyg/data-bin/raw, you can simply run pyg/mpnn.py for training. After training, the example mpnn model will dump a target.csv file which is ready to submit to CodaLab for evaluation.

Citation

Please cite as:

@article{chen2019alchemy,
  title={Alchemy: A Quantum Chemistry Dataset for Benchmarking AI Models},
  author={Chen, Guangyong and Chen, Pengfei and Hsieh, Chang-Yu and Lee, Chee-Kong and Liao, Benben and Liao, Renjie and Liu, Weiwen and Qiu, Jiezhong and Sun, Qiming and Tang, Jie and Zemel, Richard and Zhang, Shengyu},
  journal={arXiv preprint arXiv:1906.09427},
  year={2019}
}

alchemy's People

Contributors

geekinglcq avatar huiyx17 avatar ibraheem-moosa avatar lyf35 avatar moxinlin avatar mufeili avatar xptree avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

alchemy's Issues

Competition Submission Issue

Hi,

The result submission of the competition website seems out of service recently. Is there an alternative way to submit my new result and get updates of the leaderboard?

Thanks.
Haonan Wang

download.sh got 404..

Running Alchemy/pyg/data-bin/download.sh got following msg, Could you kindly update the source url?

The leaderboard evaluation code might be wrong?

I see this in the submission description.

The data entries should be sorted in an ascending order of GDB ID.

However, when I submit the original valid_target.csv(which is not sorted), I get 0.000; when I submit a sorted one, I get 1.176 MAE.

Request for test set

Hi,

Can you please provide test set regression targets in the form of dev.zip and valid.zip. I see that full dataset is released but it seems the regression targets are in different units in final_version.csv to that of dev and valid split targets. Or else, can you please provide conversion ratios of the targets. Thank you.

I did not receive verification email

When I signed up in new Alchemy Contest Codalab, I tried many email account. But I did not receive any verification email for now, spam folder was searched already.
image

[Roadmap] DGL support checklist

We should support DGL, which is another GNN library. Here is the release plan. The tentative release date is 07/31/2019, before the contest enters phase two.

[Feature] DGL dataloader

Release a DGL dataloader for reading the Alchemy dataset.

  • DGL-style Alchemy dataloader.
  • README for DGL dataloader

[Feature] DGL MPNN model

Release a DGL MPNN model as what we have done for PyG. MPNN model is GGNN + set2set, SchNet and MGCN are also included:

Segmentation fault (core dumped)

why i got the Segmentation fault (core dumped) when i am running python mpnn.py
centos and gcc version 4.8.5
my conda list is:

binutils_impl_linux-64    2.31.1               h6176602_1  
binutils_linux-64         2.31.1               h6176602_7  
blas                      1.0                         mkl  
boost                     1.68.0          py36h8619c78_1001    conda-forge
boost-cpp                 1.68.0            h11c811c_1000    conda-forge
bzip2                     1.0.6             h14c3975_1002    conda-forge
ca-certificates           2019.6.16            hecc5488_0    conda-forge
cairo                     1.16.0            h18b612c_1001    conda-forge
certifi                   2019.3.9                 py36_0    conda-forge
cffi                      1.12.3           py36h2e261b9_0  
cmake                     3.9.4                h142f0e9_0  
curl                      7.55.1               h78862de_4  
decorator                 4.4.0                    pypi_0    pypi
eigen                     3.3.7                hfd86e86_0  
expat                     2.2.6                he6710b0_0  
fontconfig                2.13.1            he4413a7_1000    conda-forge
freetype                  2.9.1                h8a8886c_1  
gcc_impl_linux-64         7.3.0                habb00fd_1  
gcc_linux-64              7.3.0                h553295d_7  
gettext                   0.19.8.1          hc5be6a0_1002    conda-forge
glib                      2.58.3            h6f030ca_1001    conda-forge
gxx_impl_linux-64         7.3.0                hdf63c60_1  
gxx_linux-64              7.3.0                h553295d_7  
h5py                      2.9.0                    pypi_0    pypi
icu                       58.2              hf484d3e_1000    conda-forge
intel-openmp              2019.4                      243  
isodate                   0.6.0                    pypi_0    pypi
joblib                    0.13.2                   pypi_0    pypi
jpeg                      9b                   h024ee3a_2  
libboost                  1.67.0               h46d08c1_4  
libedit                   3.1                  heed3624_0  
libffi                    3.2.1                hd88cf55_4  
libgcc-ng                 9.1.0                hdf63c60_0  
libgfortran-ng            7.3.0                hdf63c60_0  
libiconv                  1.15              h516909a_1005    conda-forge
libpng                    1.6.37               hbc83047_0  
libssh2                   1.8.0                h9cfc8f7_4  
libstdcxx-ng              9.1.0                hdf63c60_0  
libtiff                   4.0.10               h2733197_2  
libuuid                   2.32.1            h14c3975_1000    conda-forge
libuv                     1.26.0               h7b6447c_0  
libxcb                    1.13              h14c3975_1002    conda-forge
libxml2                   2.9.9                h13577e0_0    conda-forge
mkl                       2019.4                      243  
mkl_fft                   1.0.12           py36ha843d7b_0  
mkl_random                1.0.2            py36hd81dba3_0  
ncurses                   6.0                  h9df7e31_2  
networkx                  2.3                      pypi_0    pypi
ninja                     1.9.0            py36hfd86e86_0  
numpy                     1.16.4           py36h7e9f1db_0  
numpy-base                1.16.4           py36hde5b4d6_0  
olefile                   0.46                     py36_0  
openssl                   1.0.2r               h14c3975_0    conda-forge
pandas                    0.24.2           py36hb3f55d8_0    conda-forge
patchelf                  0.9                  he6710b0_3  
pcre                      8.41              hf484d3e_1003    conda-forge
pillow                    6.0.0            py36h34e0f95_0  
pip                       19.1.1                   py36_0  
pixman                    0.38.0            h516909a_1003    conda-forge
pkg-config                0.29.2               h1bed415_8  
plyfile                   0.7                      pypi_0    pypi
pthread-stubs             0.4               h14c3975_1001    conda-forge
py-boost                  1.67.0           py36h04863e7_4  
pycairo                   1.18.1           py36h438ddbb_0    conda-forge
pycparser                 2.19                     py36_0  
pyparsing                 2.4.0                    pypi_0    pypi
python                    3.6.2               hca45abc_19  
python-dateutil           2.8.0                      py_0    conda-forge
pytorch-cpu               1.1.0               py3.6_cpu_0    pytorch
pytz                      2019.1                     py_0    conda-forge
rdflib                    4.2.2                    pypi_0    pypi
rdkit                     2019.03.2        py36h9c20d5c_0    conda-forge
readline                  7.0                  ha6073c6_4  
rhash                     1.3.6                hb7f436b_0  
scikit-learn              0.21.2                   pypi_0    pypi
scipy                     1.3.0                    pypi_0    pypi
setuptools                41.0.1                   py36_0  
six                       1.12.0                   py36_0  
sqlite                    3.23.1               he433501_0  
tk                        8.6.8                hbc83047_0  
torch-cluster             1.4.2                    pypi_0    pypi
torch-geometric           1.2.1                    pypi_0    pypi
torch-scatter             1.2.0                    pypi_0    pypi
torch-sparse              0.4.0                    pypi_0    pypi
torchvision-cpu           0.3.0             py36_cuNone_1    pytorch
wheel                     0.33.4                   py36_0  
xorg-kbproto              1.0.7             h14c3975_1002    conda-forge
xorg-libice               1.0.9             h516909a_1004    conda-forge
xorg-libsm                1.2.3             h84519dc_1000    conda-forge
xorg-libx11               1.6.7             h14c3975_1000    conda-forge
xorg-libxau               1.0.9                h14c3975_0    conda-forge
xorg-libxdmcp             1.1.3                h516909a_0    conda-forge
xorg-libxext              1.3.4                h516909a_0    conda-forge
xorg-libxrender           0.9.10            h516909a_1002    conda-forge
xorg-renderproto          0.11.1            h14c3975_1002    conda-forge
xorg-xextproto            7.3.0             h14c3975_1002    conda-forge
xorg-xproto               7.0.31            h14c3975_1007    conda-forge
xz                        5.2.4                h14c3975_4  
zlib                      1.2.11               h7b6447c_3  
zstd                      1.3.7                h0b5b093_0  

Codalab server is down

It looks like codalab server is down, and the backup website which provided by administrator of Codalab Codalab-new had lost the data for Alchemy-contest competitions.
So for organizers of alchemy-contest, where we should submit our latest model results? Or just wait......

Request for original dataset

I visited the web site of Alchemy but could not download the original dataset as described in this issue #17.

Actually, I have emailed to Dr. Guangyong (one of the paper's authors) and received that
``the order in CSV file is randomly permuted and the data (each molecular property) is normalized for the contest.''
So I would like to use the original data like the format of the QM9 dataset,
that is, the xyz coordinates, property values, and their units (e.g., eV and eV/atom) that are not normalized.

Your code failed to read the dataset.

This is the training data downloaded with your script.

(Alchemy) xxx@xxx-Intel:~/Desktop/Alchemy$ ls data-bin/raw/dev/
dev_target.csv sdf

These files below are the data your code ask for with torch_geometric:

['data-bin/raw/dev/sdf', 'data-bin/raw/dev/train.csv']

Your code just failed with the following words when runing python2.7 pyg/mpnn.py:

Traceback (most recent call last):
File "pyg/mpnn.py", line 48, in
train_dataset = TencentAlchemyDataset(root='data-bin', mode='dev', transform=transform).shuffle()
File "/home/jtmeng/Desktop/Alchemy/pyg/Alchemy_dataset.py", line 33, in init
super(TencentAlchemyDataset, self).init(root, transform, pre_transform, pre_filter)
File "/usr/local/lib/python2.7/dist-packages/torch_geometric/data/in_memory_dataset.py", line 56, in init
pre_filter)
File "/usr/local/lib/python2.7/dist-packages/torch_geometric/data/dataset.py", line 82, in init
self._download()
File "/usr/local/lib/python2.7/dist-packages/torch_geometric/data/dataset.py", line 119, in _download
self.download()
File "/home/jtmeng/Desktop/Alchemy/pyg/Alchemy_dataset.py", line 45, in download
raise NotImplementedError('please download and unzip dataset from %s, and put it at %s' % (_urls[self.mode], self.raw_dir))
NotImplementedError: please download and unzip dataset from https://alchemy.tencent.com/data/dev.zip, and put it at data-bin/raw.

Can you help to fix your code or script to resolve the above issues? Thanks.

AttributeError: 'Tensor' object has no attribute 'local_scope'

Hi,

I am testing the dgl MPNN model. However, it ended with error

Traceback (most recent call last):
  File "train.py", line 74, in <module>
    train(args.model, int(args.epochs), device)
  File "train.py", line 48, in train
    res = model(batch.graph)
  File "/home/xl9541/pythonenv/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "/home/xl9541/tencent_alchemy/mpnn/mpnn.py", line 138, in forward
    out = self.set2set(out, g)
  File "/home/xl9541/pythonenv/pytorch/lib/python3.6/site-packages/torch/nn/modules/module.py", line 493, in __call__
    result = self.forward(*input, **kwargs)
  File "//home/xl9541/pythonenv/pytorch/lib/python3.6/site-packages/dgl/nn/pytorch/glob.py", line 273, in forward
    with graph.local_scope():
AttributeError: 'Tensor' object has no attribute 'local_scope'

It looks like the dgl graph lost this "local_scope" information. Could anyone give me some suggestions on this?

Thanks,
xy

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.