README.md 7.35 KB
Newer Older
Zihao Ye's avatar
Zihao Ye committed
1
2
3
4
5
6
7
8
9
10
11
12
13
# Graph Convolutional Matrix Completion

Paper link: [https://arxiv.org/abs/1706.02263](https://arxiv.org/abs/1706.02263)
Author's code: [https://github.com/riannevdberg/gc-mc](https://github.com/riannevdberg/gc-mc)

The implementation does not handle side-channel features and mini-epoching and thus achieves
slightly worse performance when using node features.

Credit: Jiani Zhang ([@jennyzhang0215](https://github.com/jennyzhang0215))

## Dependencies
* PyTorch 1.2+
* pandas
14
* torchtext 0.4+ (if using user and item contents as node features)
Zihao Ye's avatar
Zihao Ye committed
15
16
17
18
19
20

## Data

Supported datasets: ml-100k, ml-1m, ml-10m

## How to run
21
### Train with full-graph
Zihao Ye's avatar
Zihao Ye committed
22
23
ml-100k, no feature
```bash
24
python3 train.py --data_name=ml-100k --use_one_hot_fea --gcn_agg_accum=stack
Zihao Ye's avatar
Zihao Ye committed
25
26
```
Results: RMSE=0.9088 (0.910 reported)
27
Speed: 0.0410s/epoch (vanilla implementation: 0.1008s/epoch)
Zihao Ye's avatar
Zihao Ye committed
28
29
30

ml-100k, with feature
```bash
31
python3 train.py --data_name=ml-100k --gcn_agg_accum=stack
Zihao Ye's avatar
Zihao Ye committed
32
33
34
35
36
```
Results: RMSE=0.9448 (0.905 reported)

ml-1m, no feature
```bash
37
python3 train.py --data_name=ml-1m --gcn_agg_accum=sum --use_one_hot_fea
Zihao Ye's avatar
Zihao Ye committed
38
39
```
Results: RMSE=0.8377 (0.832 reported)
40
Speed: 0.0844s/epoch (vanilla implementation: 1.538s/epoch)
Zihao Ye's avatar
Zihao Ye committed
41
42
43

ml-10m, no feature
```bash
44
python3 train.py --data_name=ml-10m --gcn_agg_accum=stack --gcn_dropout=0.3 \
Zihao Ye's avatar
Zihao Ye committed
45
46
47
48
                                 --train_lr=0.001 --train_min_lr=0.0001 --train_max_iter=15000 \
                                 --use_one_hot_fea --gen_r_num_basis_func=4
```
Results: RMSE=0.7800 (0.777 reported)
49
50
51
52
53
54
55
56
57
58
Speed: 1.1982/epoch (vanilla implementation: OOM)
Testbed: EC2 p3.2xlarge instance(Amazon Linux 2)

### Train with minibatch on a single GPU
ml-100k, no feature
```bash
python3 train_sampling.py --data_name=ml-100k \
                          --use_one_hot_fea \
                          --gcn_agg_accum=stack \
                          --gpu 0
Zihao Ye's avatar
Zihao Ye committed
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
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
```
ml-100k, no feature with mix_cpu_gpu run, for mix_cpu_gpu run with no feature, the W_r is stored in CPU by default other than in GPU.
```bash
python3 train_sampling.py --data_name=ml-100k \
                          --use_one_hot_fea \
                          --gcn_agg_accum=stack \
                          --mix_cpu_gpu \
                          --gpu 0 
```
Results: RMSE=0.9380
Speed: 1.059s/epoch (Run with 70 epoches)
Speed: 1.046s/epoch (mix_cpu_gpu)

ml-100k, with feature
```bash
python3 train_sampling.py --data_name=ml-100k \
                          --gcn_agg_accum=stack \
                          --train_max_epoch 90 \
                          --gpu 0
```
Results: RMSE=0.9574

ml-1m, no feature
```bash
python3 train_sampling.py --data_name=ml-1m \
                          --gcn_agg_accum=sum \
                          --use_one_hot_fea \
                          --train_max_epoch 160 \
                          --gpu 0
```
ml-1m, no feature with mix_cpu_gpu run
```bash
python3 train_sampling.py --data_name=ml-1m \
                          --gcn_agg_accum=sum \
                          --use_one_hot_fea \
                          --train_max_epoch 60 \
                          --mix_cpu_gpu \
                          --gpu 0
```
Results: RMSE=0.8632
Speed: 7.852s/epoch (Run with 60 epoches)
Speed: 7.788s/epoch (mix_cpu_gpu)

ml-10m, no feature
```bash
python3 train_sampling.py --data_name=ml-10m \
                          --gcn_agg_accum=stack \
                          --gcn_dropout=0.3 \
                          --train_lr=0.001 \
                          --train_min_lr=0.0001 \
                          --train_max_epoch=60 \
                          --use_one_hot_fea \
                          --gen_r_num_basis_func=4 \
                          --gpu 0
```
ml-10m, no feature with mix_cpu_gpu run
```bash
python3 train_sampling.py --data_name=ml-10m \
                          --gcn_agg_accum=stack \
                          --gcn_dropout=0.3 \
                          --train_lr=0.001 \
                          --train_min_lr=0.0001 \
                          --train_max_epoch=60 \
                          --use_one_hot_fea \
                          --gen_r_num_basis_func=4 \
                          --mix_cpu_gpu \
                          --gpu 0
```
Results: RMSE=0.8050
Speed: 394.304s/epoch (Run with 60 epoches)
Speed: 408.749s/epoch (mix_cpu_gpu)
Testbed: EC2 p3.2xlarge instance

### Train with minibatch on multi-GPU
ml-100k, no feature
```bash
python train_sampling.py --data_name=ml-100k \
                         --gcn_agg_accum=stack \
                         --train_max_epoch 30 \
                         --train_lr 0.02 \
                         --use_one_hot_fea \
                         --gpu 0,1,2,3,4,5,6,7
```
ml-100k, no feature with mix_cpu_gpu run
```bash
python train_sampling.py --data_name=ml-100k \
                         --gcn_agg_accum=stack \
                         --train_max_epoch 30 \
                         --train_lr 0.02 \
                         --use_one_hot_fea \
                         --mix_cpu_gpu \
                         --gpu 0,1,2,3,4,5,6,7
```
Result: RMSE=0.9397
Speed: 1.202s/epoch (Run with only 30 epoches) 
Speed: 1.245/epoch (mix_cpu_gpu)

ml-100k, with feature
```bash
python train_sampling.py --data_name=ml-100k \
                         --gcn_agg_accum=stack \
                         --train_max_epoch 30 \
                         --gpu 0,1,2,3,4,5,6,7
```
Result: RMSE=0.9655
Speed:  1.265/epoch (Run with 30 epoches)

ml-1m, no feature
```bash
python train_sampling.py --data_name=ml-1m \
                         --gcn_agg_accum=sum \
                         --train_max_epoch 40 \
                         --use_one_hot_fea \
                         --gpu 0,1,2,3,4,5,6,7
```
ml-1m, no feature with mix_cpu_gpu run
```bash
python train_sampling.py --data_name=ml-1m \
                         --gcn_agg_accum=sum \
                         --train_max_epoch 40 \
                         --use_one_hot_fea \
                         --mix_cpu_gpu \
                         --gpu 0,1,2,3,4,5,6,7
```
Results: RMSE=0.8621
Speed: 11.612s/epoch (Run with 40 epoches)
Speed: 12.483s/epoch (mix_cpu_gpu)

ml-10m, no feature
```bash
python train_sampling.py --data_name=ml-10m \
                         --gcn_agg_accum=stack \
                         --gcn_dropout=0.3 \
                         --train_lr=0.001 \
                         --train_min_lr=0.0001 \
                         --train_max_epoch=30 \
                         --use_one_hot_fea \
                         --gen_r_num_basis_func=4 \
                         --gpu 0,1,2,3,4,5,6,7
```
ml-10m, no feature with mix_cpu_gpu run
```bash
python train_sampling.py --data_name=ml-10m \
                         --gcn_agg_accum=stack \
                         --gcn_dropout=0.3 \
                         --train_lr=0.001 \
                         --train_min_lr=0.0001 \
                         --train_max_epoch=30 \
                         --use_one_hot_fea \
                         --gen_r_num_basis_func=4 \
                         --mix_cpu_gpu \
                         --gpu 0,1,2,3,4,5,6,7
```
Results: RMSE=0.8084
Speed: 632.868s/epoch (Run with 30 epoches)
Speed: 633.397s/epoch (mix_cpu_gpu)
Testbed: EC2 p3.16xlarge instance

### Train with minibatch on CPU
ml-100k, no feature
```bash
python3 train_sampling.py --data_name=ml-100k \
                          --use_one_hot_fea \
                          --gcn_agg_accum=stack \
                          --gpu -1
```
Speed 1.591s/epoch
Testbed: EC2 r5.xlarge instance