This is the official implementation of DiP
- Python 3.7+
- PyTorch 1.10.0+
- PyTorch Geometric 2.1.0+
Our library versions are as follows:
- torch 2.0.0+cu117
- torch-geometric 2.3.0
- torch-scatter 2.1.1+cu117
- torch-sparse 0.6.17+cu117
- torchmetrics 1.2.0
Download our datasets from this link. You may save them to any directory you like, such as ./Multimodal-Graph-Completed-Graph. The structure should look like the following tree diagram. You can easily add new datasets following this format.
.
├── books-lp
│ ├── lp-edge-split-random.pt
│ ├── clip_feat.pt
│ ├── imagebind_feat.pt
│ ├── t5vit_feat.pt
│ └── t5dino_feat.pt
├── sports-copurchase
│ ├── lp-edge-split-hard.pt
│ ├── clip_feat.pt
│ ├── imagebind_feat.pt
│ ├── t5vit_feat.pt
│ └── t5dino_feat.pt
├── cloth-copurchase
│ ├── lp-edge-split-hard.pt
│ ├── clip_feat.pt
│ ├── imagebind_feat.pt
│ ├── t5vit_feat.pt
│ └── t5dino_feat.pt
├── ele-fashion
│ ├── nc_edges-nodeid.pt
│ ├── split.pt
│ ├── labels-w-missing.pt
│ ├── clip_feat.pt
│ ├── imagebind_feat.pt
│ ├── t5vit_feat.pt
│ └── t5dino_feat.pt
└── books-nc
├── nc_edges-nodeid.pt
├── split.pt
├── labels-w-missing.pt
├── clip_feat.pt
├── imagebind_feat.pt
├── t5vit_feat.pt
└── t5dino_feat.ptRaw images can be downloaded by using node_mapping.pt (which provides 1-1 mapping for node id and raw file id) for each dataset. A reference code for downloading can be found in download_img.py.
The products metadata can be obtained from: https://cseweb.ucsd.edu/~jmcauley/datasets.html#amazon_reviews and https://mengtingwan.github.io/data/goodreads.html. The zipped folder can be found here.
Raw images can be downloaded by using node_mapping.pt (which provides 1-1 mapping for node id and raw file id) for each dataset.
The products metadata can be obtained from: https://cseweb.ucsd.edu/~jmcauley/datasets.html#amazon_reviews and https://mengtingwan.github.io/data/goodreads.html. The zipped folder can be found here.
- For Link Prediction Task:
cd lp
CUDA_VISIBLE_DEVICES=0 python train.py --config_path configs/sports-copurchase.yaml --npnode_v 128 --npnode_t 32- For Node Classification Task:
cd nc
CUDA_VISIBLE_DEVICES=5 python train.py --config_path configs/ele-fashion.yaml --npnode_v 512 --npnode_t 64