Skip to content
项目
群组
代码片段
帮助
当前项目
正在载入...
登录 / 注册
切换导航面板
B
BiTransDPI
概览
概览
详情
活动
周期分析
版本库
存储库
文件
提交
分支
标签
贡献者
分支图
比较
统计图
问题
0
议题
0
列表
看板
标记
里程碑
CI / CD
CI / CD
流水线
日程表
维基
Wiki
代码片段
代码片段
成员
成员
折叠边栏
关闭边栏
活动
图像
聊天
创建新问题
提交
问题看板
Open sidebar
杨志辉
BiTransDPI
Commits
cb4c0cc6
提交
cb4c0cc6
authored
5月 27, 2021
作者:
朱学凯
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add some
上级
a443adb1
显示空白字符变更
内嵌
并排
正在显示
4 个修改的文件
包含
41 行增加
和
0 行删除
+41
-0
eval.py
eval.py
+39
-0
e-20-z-1.txt
log/e-20-z-1.txt
+0
-0
e-30.txt
log/e-30.txt
+0
-0
pre_test.sh
pre_test.sh
+2
-0
没有找到文件。
eval.py
0 → 100644
浏览文件 @
cb4c0cc6
import
numpy
as
np
import
re
def
eval_result
(
pred
,
label
):
pred
=
np
.
array
(
pred
)
label
=
np
.
array
(
label
)
num
=
len
(
pred
)
diff
=
pred
-
label
mse
=
np
.
sum
(
np
.
power
(
diff
,
2
))
/
num
rmse
=
np
.
sqrt
(
mse
)
pearson_co
=
np
.
corrcoef
(
pred
,
label
)
return
rmse
,
pearson_co
def
eval
(
pred_path
,
label_path
):
with
open
(
pred_path
,
'r'
)
as
f
:
pred
=
f
.
readlines
()
pred
=
[
float
(
i
.
strip
())
for
i
in
pred
]
with
open
(
label_path
,
'r'
)
as
f
:
label
=
f
.
readlines
()
label
=
[
float
(
i
.
strip
())
for
i
in
label
]
remse
,
r_mat
=
eval_result
(
pred
,
label
)
r
=
r_mat
[
0
,
1
]
save_path
=
pred_path
.
replace
(
'test.txt'
,
'eval_results'
)
with
open
(
save_path
,
'w'
)
as
f
:
f
.
write
(
'RMSE : {} ; Pearson Correlation Coefficient : {}'
.
format
(
remse
,
r
))
print
(
'RMSE : {} ; Pearson Correlation Coefficient : {}'
.
format
(
remse
,
r
))
if
__name__
==
'__main__'
:
# with open('pre_test.sh', 'r') as f:
# pred_dir = f.readline()
# pred_dir = pred_dir.split()[5].split('/')[-1]
# pred_result = './predict/{}/test.txt'.format(pred_dir)
pred_result
=
'./predict/lr-1e-5-batch-32-e-10-layer3-0503-z-1-step-82370/test.txt'
test_label_path
=
'./data/test_ic50'
eval
(
pred_result
,
test_label_path
)
e-20-z-1.txt
→
log/
e-20-z-1.txt
浏览文件 @
cb4c0cc6
File moved
e-30.txt
→
log/
e-30.txt
浏览文件 @
cb4c0cc6
File moved
pre_test.sh
0 → 100644
浏览文件 @
cb4c0cc6
CUDA_VISIBLE_DEVICES
=
1 python run_interaction.py
--task
=
test
--b
=
64
--output
=
./predict/lr-1e-5-batch-32-e-10-layer3-0503-z-1-step-65896
--config
=
./config/config_layer_3.json
--init
=
./model/lr-1e-5-batch-32-e-10-layer3-0503-z-1/epoch-7-step-65896-loss-0.39236504916727866.pth
--do_eval
=
'True'
\ No newline at end of file
编写
预览
Markdown
格式
0%
重试
或
添加新文件
添加附件
取消
您添加了
0
人
到此讨论。请谨慎行事。
请先完成此评论的编辑!
取消
请
注册
或者
登录
后发表评论