forked from zouxiaochuan/code_ogblsc2022
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcheck_result.py
36 lines (28 loc) · 1.29 KB
/
check_result.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
import numpy as np
import os
import common_utils
import cluster_utils
import pandas as pd
predict_files = [
'models_valid/final0_dropout_decay1_0.97_h32_hidden256_fastedge_inter8_bondreverse_noxyz_l24_cont2/pred_057.npy',
'models_valid/final0_dropout_decay1_0.97_h32_hidden256_fastedge_inter8_bondreverse_noxyz_l30/pred_075.npy'
]
split = 0
if __name__ == '__main__':
scores_list = []
for predict_file in predict_files:
scores = np.load(predict_file).flatten()
scores_list.append(scores)
pass
scores = np.mean(np.stack(scores_list, axis=0), axis=0)
data_path = os.path.expanduser('~/data/zouxiaochuan/middle_data/pcqm4m/')
y = pd.read_csv('../ogblsc_data/pcqm4m-v2/raw/data.csv.gz')['homolumogap'].values.flatten()
idx_split = common_utils.load_obj(os.path.join(data_path, 'idx_split.pkl'))
idx_train_valid = np.concatenate([idx_split['train'], idx_split['valid']])
idx_train = idx_train_valid[np.arange(len(idx_train_valid)) % 50 != split]
idx_valid = idx_train_valid[np.arange(len(idx_train_valid)) % 50 == split]
print(np.abs(scores - y)[idx_valid].mean())
print(np.abs(scores - y)[idx_train].mean())
print(np.abs(scores - y)[idx_split['train'][:1000]].mean())
print(np.abs(scores - y)[idx_split['valid']].mean())
pass