Downloads · 30 days
0
Qornck/Lightgcn_bert
Lightgcn_bert is a machine learning model from Qornck. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
Downloads · 30 days
0
Access
Public
Updated Nov 7, 2024
Repo size
1.7 GB
Likes
0
Public
Click a slice to open those files.
.txt1.4 GB · 99%
From the Hugging Face model README
pip install -r requirements.txt
We provide three processed datasets: Gowalla, Yelp2018 and Amazon-book and one small dataset LastFM.
see more in dataloader.py
run LightGCN on Gowalla dataset:
cd code && python main.py --decay=1e-4 --lr=0.001 --layer=3 --seed=2020 --dataset="gowalla" --topks="[20]" --recdim=64
python main.py --decay=1e-4 --lr=0.001 --layer=3 --seed=2020 --dataset="Movies_and_TV" --topks="[20]" --recdim=64
python main.py --decay=1e-4 --lr=0.001 --layer=3 --seed=2020 --dataset="Luxury_Beauty" --topks="[20]" --recdim=64 --testbatch=80
python main.py --decay=1e-4 --lr=0.001 --layer=3 --seed=2020 --dataset="Video_Games" --topks="[20]" --recdim=64
...
======================
EPOCH[5/1000]
BPR[sample time][16.2=15.84+0.42]
[saved][[BPR[aver loss1.128e-01]]
[0;30;43m[TEST][0m
{'precision': array([0.03315359]), 'recall': array([0.10711388]), 'ndcg': array([0.08940792])}
[TOTAL TIME] 35.9975962638855
...
======================
EPOCH[116/1000]
BPR[sample time][16.9=16.60+0.45]
[saved][[BPR[aver loss2.056e-02]]
[TOTAL TIME] 30.99874997138977
...
NOTE:
testbatch and enable multicore(Windows system may encounter problems with multicore option enabled)tensorboard option, it's good.--seed=2020 ) of numpy and torch in the beginning, if you run the command as we do above, you should have the exact output log despite the running time (check your output of epoch 5 and epoch 116).dataloader.py, and implement a dataloader inherited from BasicDataset. Then register it in register.py.model.py, and implement a model inherited from BasicModel. Then register it in register.py.Procedure.py, and implement a function. Then modify the corresponding code in main.pyall metrics is under top-20
pytorch version results (stop at 1000 epochs):
(for seed=2020)
| Recall | ndcg | precision | |
|---|---|---|---|
| layer=1 | 0.1687 | 0.1417 | 0.05106 |
| layer=2 | 0.1786 | 0.1524 | 0.05456 |
| layer=3 | 0.1824 | 0.1547 | 0.05589 |
| layer=4 | 0.1825 | 0.1537 | 0.05576 |
| Recall | ndcg | precision | |
|---|---|---|---|
| layer=1 | 0.05604 | 0.04557 | 0.02519 |
| layer=2 | 0.05988 | 0.04956 | 0.0271 |
| layer=3 | 0.06347 | 0.05238 | 0.0285 |
| layer=4 | 0.06515 | 0.05325 | 0.02917 |