Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
shiyivei
Paddle
提交
d2b10cc0
P
Paddle
项目概览
shiyivei
/
Paddle
与 Fork 源项目一致
Fork自
PaddlePaddle / Paddle
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1
Issue
1
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d2b10cc0
编写于
10月 27, 2017
作者:
Y
yangyaming
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Refine doc and fix data type of metrics.
上级
97bfc0df
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
5 deletion
+5
-5
paddle/operators/precision_recall_op.cc
paddle/operators/precision_recall_op.cc
+2
-2
paddle/operators/precision_recall_op.h
paddle/operators/precision_recall_op.h
+3
-3
未找到文件。
paddle/operators/precision_recall_op.cc
浏览文件 @
d2b10cc0
...
...
@@ -136,9 +136,9 @@ to compute various metrics including:
- micro average recall
- micro f1 score
To compute the above metrics, we need to
statistic count
s for true positives,
To compute the above metrics, we need to
do statistic
s for true positives,
false positives and false negatives. Here count of true negatives is not
necessary, but
statistic
ing it may provide potential usage and the cost is
necessary, but
count
ing it may provide potential usage and the cost is
trivial, so the operator also provides count of true negatives.
We define state as a 2-D tensor with shape [class number, 4]. Each row of a
...
...
paddle/operators/precision_recall_op.h
浏览文件 @
d2b10cc0
...
...
@@ -42,8 +42,8 @@ class PrecisionRecallKernel : public framework::OpKernel<T> {
const
int
*
labels_data
=
in1
->
data
<
int
>
();
const
T
*
weights_data
=
in2
?
in2
->
data
<
T
>
()
:
nullptr
;
const
T
*
states_data
=
in3
?
in3
->
data
<
T
>
()
:
nullptr
;
T
*
batch_metrics_data
=
out0
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
T
*
accum_metrics_data
=
out1
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
double
*
batch_metrics_data
=
out0
->
mutable_data
<
double
>
(
ctx
.
GetPlace
());
double
*
accum_metrics_data
=
out1
->
mutable_data
<
double
>
(
ctx
.
GetPlace
());
out2
->
mutable_data
<
T
>
(
ctx
.
GetPlace
());
auto
accum_states
=
EigenMatrix
<
T
>::
From
(
*
out2
);
accum_states
.
setZero
();
...
...
@@ -121,7 +121,7 @@ class PrecisionRecallKernel : public framework::OpKernel<T> {
}
protected:
void
ComputeMetrics
(
const
T
*
states_data
,
T
*
metrics_data
,
void
ComputeMetrics
(
const
T
*
states_data
,
double
*
metrics_data
,
size_t
state_var_num
,
size_t
class_dim
)
const
{
T
total_tp_count
=
0
;
T
total_fp_count
=
0
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录