Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
Paddle
提交
b6ac64a3
P
Paddle
项目概览
PaddlePaddle
/
Paddle
1 年多 前同步成功
通知
2302
Star
20931
Fork
5422
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
1423
列表
看板
标记
里程碑
合并请求
543
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
Paddle
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
1,423
Issue
1,423
列表
看板
标记
里程碑
合并请求
543
合并请求
543
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
b6ac64a3
编写于
2月 23, 2017
作者:
Y
Yu Yang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Remove unnecessary error default value.
上级
b1ab8b56
变更
3
显示空白变更内容
内联
并排
Showing
3 changed file
with
9 addition
and
22 deletion
+9
-22
paddle/gserver/evaluators/Evaluator.cpp
paddle/gserver/evaluators/Evaluator.cpp
+1
-7
paddle/gserver/evaluators/Evaluator.h
paddle/gserver/evaluators/Evaluator.h
+7
-14
paddle/gserver/gradientmachines/NeuralNetwork.cpp
paddle/gserver/gradientmachines/NeuralNetwork.cpp
+1
-1
未找到文件。
paddle/gserver/evaluators/Evaluator.cpp
浏览文件 @
b6ac64a3
...
@@ -781,9 +781,7 @@ real PrecisionRecallEvaluator::getValue(const std::string& name,
...
@@ -781,9 +781,7 @@ real PrecisionRecallEvaluator::getValue(const std::string& name,
paddle
::
str
::
split
(
name
,
'.'
,
&
buffers
);
paddle
::
str
::
split
(
name
,
'.'
,
&
buffers
);
auto
it
=
this
->
values_
.
find
(
buffers
[
buffers
.
size
()
-
1
]);
auto
it
=
this
->
values_
.
find
(
buffers
[
buffers
.
size
()
-
1
]);
if
(
it
==
this
->
values_
.
end
())
{
// not found
if
(
it
==
this
->
values_
.
end
())
{
// not found
if
(
err
!=
nullptr
)
{
*
err
=
Error
(
"No such key %s"
,
name
.
c_str
());
*
err
=
Error
(
"No such key %s"
,
name
.
c_str
());
}
return
.0
f
;
return
.0
f
;
}
}
...
@@ -792,10 +790,6 @@ real PrecisionRecallEvaluator::getValue(const std::string& name,
...
@@ -792,10 +790,6 @@ real PrecisionRecallEvaluator::getValue(const std::string& name,
std
::
string
PrecisionRecallEvaluator
::
getType
(
const
std
::
string
&
name
,
std
::
string
PrecisionRecallEvaluator
::
getType
(
const
std
::
string
&
name
,
Error
*
err
)
const
{
Error
*
err
)
const
{
Error
localErr
;
if
(
err
==
nullptr
)
{
err
=
&
localErr
;
}
this
->
getValue
(
name
,
err
);
this
->
getValue
(
name
,
err
);
if
(
!
err
->
isOK
())
{
if
(
!
err
->
isOK
())
{
return
""
;
return
""
;
...
...
paddle/gserver/evaluators/Evaluator.h
浏览文件 @
b6ac64a3
...
@@ -141,16 +141,13 @@ public:
...
@@ -141,16 +141,13 @@ public:
* @brief getValue will return the current evaluate value of one field.
* @brief getValue will return the current evaluate value of one field.
*
*
* @param name: The field name of current evaluator.
* @param name: The field name of current evaluator.
* @param err [out]: The error state.
nullptr means don't care.
* @param err [out]: The error state.
*
*
* @return The evaluate value(metric).
* @return The evaluate value(metric).
*/
*/
virtual
real
getValue
(
const
std
::
string
&
name
,
virtual
real
getValue
(
const
std
::
string
&
name
,
paddle
::
Error
*
err
)
const
{
paddle
::
Error
*
err
=
nullptr
)
const
{
if
(
name
!=
config_
.
name
())
{
if
(
name
!=
config_
.
name
())
{
if
(
err
!=
nullptr
)
{
*
err
=
paddle
::
Error
(
"no such name of evaluator %s"
,
name
.
c_str
());
*
err
=
paddle
::
Error
(
"no such name of evaluator %s"
,
name
.
c_str
());
}
return
.0
f
;
return
.0
f
;
}
}
return
this
->
getValueImpl
();
return
this
->
getValueImpl
();
...
@@ -168,8 +165,8 @@ public:
...
@@ -168,8 +165,8 @@ public:
* @return the evaluator type string.
* @return the evaluator type string.
*/
*/
virtual
std
::
string
getType
(
const
std
::
string
&
name
,
virtual
std
::
string
getType
(
const
std
::
string
&
name
,
paddle
::
Error
*
err
=
nullptr
)
const
{
paddle
::
Error
*
err
)
const
{
if
(
name
!=
config_
.
name
()
&&
err
!=
nullptr
)
{
if
(
name
!=
config_
.
name
())
{
*
err
=
paddle
::
Error
(
"no such name of evaluator %s"
,
name
.
c_str
());
*
err
=
paddle
::
Error
(
"no such name of evaluator %s"
,
name
.
c_str
());
return
std
::
string
();
return
std
::
string
();
}
}
...
@@ -212,15 +209,11 @@ public:
...
@@ -212,15 +209,11 @@ public:
void
getNames
(
std
::
vector
<
std
::
string
>*
names
)
{}
void
getNames
(
std
::
vector
<
std
::
string
>*
names
)
{}
real
getValue
(
const
std
::
string
&
name
,
Error
*
err
)
const
{
real
getValue
(
const
std
::
string
&
name
,
Error
*
err
)
const
{
if
(
err
!=
nullptr
)
{
*
err
=
Error
(
"Not implemented"
);
*
err
=
Error
(
"Not implemented"
);
}
return
.0
f
;
return
.0
f
;
}
}
std
::
string
getType
(
const
std
::
string
&
name
,
Error
*
err
)
const
{
std
::
string
getType
(
const
std
::
string
&
name
,
Error
*
err
)
const
{
if
(
err
!=
nullptr
)
{
*
err
=
Error
(
"Not implemented"
);
*
err
=
Error
(
"Not implemented"
);
}
return
""
;
return
""
;
}
}
};
};
...
...
paddle/gserver/gradientmachines/NeuralNetwork.cpp
浏览文件 @
b6ac64a3
...
@@ -391,7 +391,7 @@ private:
...
@@ -391,7 +391,7 @@ private:
return
callback
(
eval
);
return
callback
(
eval
);
}
}
}
}
if
(
err
!=
nullptr
)
*
err
=
Error
(
"No such key %s"
,
name
.
c_str
());
*
err
=
Error
(
"No such key %s"
,
name
.
c_str
());
return
T
();
return
T
();
}
}
};
};
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录