Datasets:

ArXiv:
License:
File size: 2,116 Bytes
1be89f3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef73a56
1be89f3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
# Reproducibility Guide

## Overview

This part of repo contains the implementation and experiments. This guide will help you reproduce the results using Docker or manual installation.

---

## Docker Setup (Recommended)

### 1. Build Docker Image

```bash
docker build -t yambda-image .
```

### 2. Run Container with GPU Support

```bash
docker run --gpus all \
           --runtime=nvidia \
           -it \
           -v </absolute/path/to/local/data>:/yambda/data \
           yambda-image
```

---

## Data Organization

Create following structure in mounted data directory:

```bash
data/
β”œβ”€β”€ flat/
β”‚   └── 50m/
β”‚       β”œβ”€β”€ likes.parquet
β”‚       β”œβ”€β”€ listens.parquet
β”‚       └── ...
└── sequential/
    └── 50m/
        β”œβ”€β”€ likes.parquet
        β”œβ”€β”€ listens.parquet
        └── ...
```

Note:
    Sequential data is only needed for sasrec. You can build it from flat using scripts/transform2sequential.py or download

---

## Running Experiments

### General Usage

```bash
# For example random_rec

cd models/random_rec/

# Show help for main script
python main.py --help

# Basic execution
python main.py
```

### Specific Methods

#### BPR/ALS

```bash
cd models/bpr_als

python main.py --model bpr
python main.py --model als
```

#### SASRec

```bash
cd models/sasrec

# Training
python train.py --exp_name exp1

# Evaluation
python eval.py --exp_name exp1 
```
---

## Manual Installation (Not Recommedned)

### 1. Install Core Dependencies

```bash
pip install torch torchvision torchaudio
```

### 2. Install Implicit (CUDA 11.8 required)

Implicit works only with cuda<12. See reasons [here](https://github.com/NVIDIA/nvidia-docker/issues/700#issuecomment-381073278)

```bash
CUDACXX=/usr/local/cuda-11.8/bin/nvcc \
pip install implicit
```

### 3. Install SANSA

```bash
sudo apt-get install libsuitesparse-dev
git clone https://github.com/glami/sansa.git
cd sansa && \
SUITESPARSE_INCLUDE_DIR=/usr/include/suitesparse \
SUITESPARSE_LIBRARY_DIR=/usr/lib \
pip install .
```

### 4. Install Project Package

```bash
pip install .
```