forked from Coder-Yu/SELFRec
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
39 lines (35 loc) · 1.34 KB
/
main.py
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
from SELFRec import SELFRec
from util.conf import ModelConf
if __name__ == '__main__':
# Register your model here
graph_baselines = ['LightGCN','DirectAU','MF']
ssl_graph_models = ['SGL', 'SimGCL', 'SEPT', 'MHCN', 'BUIR', 'SelfCF', 'SSL4Rec', 'XSimGCL', 'NCL','MixGCF']
sequential_baselines= ['SASRec']
ssl_sequential_models = ['CL4SRec','DuoRec','BERT4Rec']
print('=' * 80)
print(' SELFRec: A library for self-supervised recommendation. ')
print('=' * 80)
print('Graph-Based Baseline Models:')
print(' '.join(graph_baselines))
print('-' * 100)
print('Self-Supervised Graph-Based Models:')
print(' '.join(ssl_graph_models))
print('=' * 80)
print('Sequential Baseline Models:')
print(' '.join(sequential_baselines))
print('-' * 100)
print('Self-Supervised Sequential Models:')
print(' '.join(ssl_sequential_models))
print('=' * 80)
model = input('Please enter the model you want to run:')
import time
s = time.time()
if model in graph_baselines or model in ssl_graph_models or model in sequential_baselines or model in ssl_sequential_models:
conf = ModelConf('./conf/' + model + '.conf')
else:
print('Wrong model name!')
exit(-1)
rec = SELFRec(conf)
rec.execute()
e = time.time()
print("Running time: %f s" % (e - s))