Skip to content

Commit

Permalink
Merge branch 'PaddlePaddle:main' into pna
Browse files Browse the repository at this point in the history
  • Loading branch information
dongZheX committed Sep 27, 2022
2 parents 0779eaf + 28fc540 commit 7c778b2
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 3 deletions.
37 changes: 37 additions & 0 deletions examples/pna/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# Principal Neighbourhood Aggregation for Graph Nets (PNA)

[Principal Neighbourhood Aggregation for Graph Nets \(PNA\)](https://arxiv.org/abs/2004.05718) is a graph learning model combining multiple aggregators with degree-scalers.


### Datasets

We perform graph classification experiment to reproduce paper results on [OGB](https://ogb.stanford.edu/).

### Dependencies

- paddlepaddle >= 2.2.0
- pgl >= 2.2.4

### How to run


```
python main.py --config config.yaml # train on ogbg-molhiv
python main.py --config config_pcba.yaml # train on ogbg-molpcba
```


### Important Hyperparameters

- aggregators: a list of aggregators name. ("mean", "sum", "max", "min", "var", "std")
- scalers: a list of scalers name. ("identity", "amplification", "attenuation", "linear", "inverse_linear")
- tower: The number of towers.
- divide_input: hether the input features should be split between towers or not.
- pre_layers: the number of MLP layers behind aggregators.
- post_layers: MLP layers after aggregator.

### Experiment results (ROC-AUC)
| | GIN | PNA(paper result) | PNA(ours)|
|-------------|----------|------------|-----------------|
|HIV | 0.7778 | 0.7905 | 0.7929 |
|PCBA | 0.2266 | 0.2838 | 0.2801 |
3 changes: 0 additions & 3 deletions examples/pna/config_pcba.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,3 @@ log_filename: log.txt
save_dir: ./checkpoints
output_dir: ./outputs
files2saved: ["*.yaml", "*.py", "./utils"]

# python main_PCBA.py --type_net="complex" --batch_size=512 --lap_norm="none" --weight_decay=3e-6 --L=4 --hidden_dim=510 --out_dim=510 --residual=True
# --edge_feat=True --readout=sum --graph_norm=True --batch_norm=True --aggregators="mean sum max" --scalers="identity" --config "configs/molecules_graph_classification_DGN_PCBA.json" --lr_schedule_patience=4 --towers=5 --dropout=0.2 --init_lr=0.0005 --min_lr=0.00002 --edge_dim=16 --lr_reduce_factor=0.8

0 comments on commit 7c778b2

Please sign in to comment.