forked from yl-1993/learn-to-cluster
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cut_train_cfg_trial.py
68 lines (55 loc) · 1.57 KB
/
cut_train_cfg_trial.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
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
import os.path as osp
# data cutting
train_name_cut = 'part0_train'
test_name_cut = 'part0_train'
# data locations
prefix = './data'
train_name = 'part0_train'
test_name = 'part1_test'
knn = 80 #file name (check knn file)
knn_method = 'faiss'
train_data = dict(
feat_path=osp.join(prefix, 'features', '{}.bin'.format(train_name)),
label_path=osp.join(prefix, 'labels', '{}.meta'.format(train_name)),
knn_graph_path=osp.join(prefix, 'knns', train_name,
'{}_k_{}.npz'.format(knn_method, knn)),
k_at_hop=[40, 5], #200,10
active_connection=5, #10
is_norm_feat=True,
is_sort_knns=True,
)
test_data = dict(
feat_path=osp.join(prefix, 'features', '{}.bin'.format(test_name)),
label_path=osp.join(prefix, 'labels', '{}.meta'.format(test_name)),
knn_graph_path=osp.join(prefix, 'knns', test_name,
'{}_k_{}.npz'.format(knn_method, knn)),
k_at_hop=[40, 5],
active_connection=10,
is_norm_feat=True,
is_sort_knns=True,
is_test=True,
)
# model
model = dict(type='gae', kwargs=dict(feature_dim=256))
# training args
optimizer = dict(type='SGD', lr=0.01, momentum=0.9, weight_decay=1e-4)
optimizer_config = {}
lr_config = dict(
policy='step',
step=[1, 2, 3],
)
batch_size_per_gpu = 16
total_epochs = 1 #org=4
workflow = [('train', 1)]
# testing args
max_sz = 300
step = 0.6
pool = 'avg'
metrics = ['pairwise', 'bcubed', 'nmi']
# misc
workers_per_gpu = 1
checkpoint_config = dict(interval=1)
log_level = 'INFO'
log_config = dict(interval=200, hooks=[
dict(type='TextLoggerHook'),
])