Skip to content

Commit

Permalink
Merge pull request #58 from PaddlePaddle/dev
Browse files Browse the repository at this point in the history
Fix __init__.py
  • Loading branch information
xiaoyao4573 authored Dec 18, 2020
2 parents aea3101 + dd235a7 commit d20754f
Show file tree
Hide file tree
Showing 13 changed files with 427 additions and 96 deletions.
6 changes: 6 additions & 0 deletions apps/pretrained_compound/pretrain_gnns/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ You can download the [pretrained models](https://baidu-nlp.bj.bcebos.com/PaddleH
#### Data link
You can choose to download the dataset from the [link](http://snap.stanford.edu/gnn-pretrain/data/chem_dataset.zip) provided by us and perform the corresponding preprocessing for your use. It is recommended to unzip the data set and put it in the data folder under the root directory, if not, please create a new data folder.

# cd to PaddleHelix folder
mkdir -p data
cd data
wget http://snap.stanford.edu/gnn-pretrain/data/chem_dataset.zip
unzip chem_dataset.zip

### Training Models

The training methods of the pre-training strategy we provide are divided into two aspects. The first is the pre-training at the node level. There are two methods. The second is the supervised pre-training strategy for the whole image. You can choose during the specific experiment. Perform pre-training at the node level first, and then perform the pre-training at the graph level at the entire graph level, as follows:
Expand Down
6 changes: 6 additions & 0 deletions apps/pretrained_compound/pretrain_gnns/README_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
#### 数据地址
您可以选择从我们提供的[网址](http://snap.stanford.edu/gnn-pretrain/data/chem_dataset.zip)上下载数据集然后进行相应的预处理来供您使用。建议解压数据集并将其放入根目录下的data文件夹中,如果没有请新建一个data文件夹。

# cd to PaddleHelix folder
mkdir -p data
cd data
wget http://snap.stanford.edu/gnn-pretrain/data/chem_dataset.zip
unzip chem_dataset.zip

### 模型训练

我们提供的预训练策略的训练方式分为两个方面,首先是在节点级别的预训练,一共有两种方法,其次是整图的监督预训练策略,在具体实验的过程中,你可以选择先在节点级别进行预训练,再在整图级别上进行图级别的预训练,具体模型结构图如下:
Expand Down
16 changes: 14 additions & 2 deletions installation_guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,20 @@ conda install -c conda-forge rdkit
```
5. Install `paddle` based on your choice of GPU/CPU version:

Check `paddlepaddle`'s [official document](https://www.paddlepaddle.org.cn/documentation/docs/en/install/index_en.html)
to install **paddle2.0**.
Check `paddlepaddle`'s [official document](https://www.paddlepaddle.org.cn/documentation/docs/en/2.0-rc1/install/index_en.html)
to install **paddle2.0**.

For example, if you want to use GPU version of PaddlePaddle on Linux, run this command:

```bash
python -m pip install paddlepaddle-gpu==2.0.0rc1.post90 -f https://paddlepaddle.org.cn/whl/stable.html
```

Or if you want to use CPU version of PaddlePaddle on Linux, run this command:

```bash
python -m pip install paddlepaddle==2.0.0rc1 -i https://mirror.baidu.com/pypi/simple
```

6. Install `PGL` using pip:

Expand Down
14 changes: 13 additions & 1 deletion installation_guide_cn.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,19 @@ conda install -c conda-forge rdkit
```
5. 基于你对 CPU/GPU 版本的选择来安装 `paddle`:

请注意安装 **paddle2.0** 以上版本,方法参见 paddlepaddle [官方文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.0-rc1/install/index_cn.html)
请注意安装 **paddle2.0** 以上版本,方法参见 paddlepaddle [官方文档](https://www.paddlepaddle.org.cn/documentation/docs/zh/2.0-rc1/install/index_cn.html)

比如,你想在 Linux 系统上安装 paddlepaddle 2.0 GPU 版本,你可以运行以下命令:

```bash
python -m pip install paddlepaddle-gpu==2.0.0rc1.post90 -f https://paddlepaddle.org.cn/whl/stable.html
```

如果你想在 Linux 系统上安装 paddlepaddle 2.0 CPU 版本,你可以运行以下命令:

```bash
python -m pip install paddlepaddle==2.0.0rc1 -i https://mirror.baidu.com/pypi/simple
```

6. 使用 pip 命令安装`PGL`:
```bash
Expand Down
18 changes: 18 additions & 0 deletions pahelix/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Initialize.
"""

34 changes: 34 additions & 0 deletions pahelix/datasets/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Initialize datasets.
"""

from pahelix.datasets.inmemory_dataset import *
from pahelix.datasets.zinc_dataset import *
from pahelix.datasets.chembl_filtered_dataset import *
from pahelix.datasets.bace_dataset import *
from pahelix.datasets.bbbp_dataset import *
from pahelix.datasets.clintox_dataset import *
from pahelix.datasets.esol_dataset import *
from pahelix.datasets.freesolv_dataset import *
from pahelix.datasets.hiv_dataset import *
from pahelix.datasets.lipophilicity_dataset import *
from pahelix.datasets.muv_dataset import *
from pahelix.datasets.sider_dataset import *
from pahelix.datasets.tox21_dataset import *
from pahelix.datasets.toxcast_dataset import *
from pahelix.datasets.mutag_dataset import *
from pahelix.datasets.ptc_mr_dataset import *
20 changes: 20 additions & 0 deletions pahelix/featurizers/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Initialize featurizers.
"""

from pahelix.featurizers.featurizer import *
from pahelix.featurizers.pretrain_gnn_featurizer import *
19 changes: 19 additions & 0 deletions pahelix/model_zoo/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
model zoo.
"""

from pahelix.model_zoo.pretrain_gnns_model import *
18 changes: 18 additions & 0 deletions pahelix/networks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Initialize model related tools.
"""

Empty file added pahelix/tests/__init__.py
Empty file.
17 changes: 17 additions & 0 deletions pahelix/utils/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Copyright (c) 2020 PaddlePaddle Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""
Initialize feature related tools.
"""
Loading

0 comments on commit d20754f

Please sign in to comment.