https://github.com/oceanlvr/protoau
Pytorch implementation of ProtoAU for recommendation.
https://github.com/oceanlvr/protoau
contrastive-learning gnn-model recommendation recommendation-system
Last synced: 2 months ago
JSON representation
Pytorch implementation of ProtoAU for recommendation.
- Host: GitHub
- URL: https://github.com/oceanlvr/protoau
- Owner: oceanlvr
- Created: 2024-01-12T17:59:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2024-12-19T08:43:05.000Z (6 months ago)
- Last Synced: 2025-04-14T21:12:35.178Z (2 months ago)
- Topics: contrastive-learning, gnn-model, recommendation, recommendation-system
- Language: Python
- Homepage: https://ieeexplore.ieee.org/document/10650218
- Size: 54.9 MB
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ProtoAU
Pytorch implementation of ProtoAU for recommendation.
We present the **Proto**typical contrastive learning through **A**lignment and **U**niformity for recommendation, which is called **ProtoAU**.
A contrastive learning method for recommendation that excels in capturing intricate relationships between user and item interactions, which enhance the basic GNN-based recommendation model's generalization ability and robustness.Thanks for following our work! :)
## Prepare
There are two environment you can choose: nvidia-docker environment or normal environment.
- For nvidia-docker users, you need to install nvidia-docker2 and restart docker service.
```sh
# docker env
docker build -t protoau .
docker run -itd --gpus all --name protoau
docker exec -it protoau /bin/bash # enter the container
```- For normal users, you need to install pytorch and other packages. here we use follow environment:
- Python 3.6
- Pytorch 1.9 (GPU version)
- CUDA 11.1
- cudnn 8then run follow command to install other packages:
```sh
pip install -r requirements.txt
```## Quickstart
- Arguments:
- Config the model arguments in `conf/ProtoAU.yaml`- Train:
```sh
# train
nohup python index.py --gpu_id=0 --model=ProtoAU --run_name=ProtoAU --dataset=yelp2018 > ./0.log 2>&1 &# Parallel train(optional)
wandb sweep --project sweep_parallel ./sweep/ProtoAU.yaml # step 1
wandb agent --count 5 oceanlvr/sweep_parallel/[xxx] # replace the [xxx] with your sweep id (step 1 generated)
```
3. For all metric results, you could see the output in the `./0.log` file or the wandb dashboard.
4. For visualizing the results, run python3 `visualize/feature.py`.## Datasets
DataSet
Users
Items
Ratings
Density
Douban
2,848
39,586
894,887
0.794%
LastFM
1,892
17,632
92,834
0.27%
Yelp
19,539
21,266
450,884
0.11%
Amazon-Book
52,463
91,599
2,984,108
0.11%
## Reference
- https://github.com/coder-Yu/SELFRec/
- https://github.com/RUCAIBox/RecBole2.0## Cite
Please cite our paper [ieeexplore.ieee.org/document/10650218](https://ieeexplore.ieee.org/document/10650218/) if you use this code.