Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
机器未来
Paddle
提交
a040239d
P
Paddle
项目概览
机器未来
/
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看板
未验证
提交
a040239d
编写于
2月 16, 2018
作者:
S
Siddharth Goyal
提交者:
GitHub
2月 16, 2018
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add conv test case for inference-recognize digits (#8466)
上级
65fd84a5
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
5 addition
and
4 deletion
+5
-4
paddle/fluid/inference/tests/book/CMakeLists.txt
paddle/fluid/inference/tests/book/CMakeLists.txt
+1
-1
paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc
...d/inference/tests/book/test_inference_recognize_digits.cc
+1
-1
python/paddle/v2/fluid/tests/book/test_recognize_digits.py
python/paddle/v2/fluid/tests/book/test_recognize_digits.py
+3
-2
未找到文件。
paddle/fluid/inference/tests/book/CMakeLists.txt
浏览文件 @
a040239d
...
@@ -27,7 +27,7 @@ endfunction(inference_test)
...
@@ -27,7 +27,7 @@ endfunction(inference_test)
inference_test
(
fit_a_line
)
inference_test
(
fit_a_line
)
inference_test
(
image_classification ARGS vgg resnet
)
inference_test
(
image_classification ARGS vgg resnet
)
inference_test
(
label_semantic_roles
)
inference_test
(
label_semantic_roles
)
inference_test
(
recognize_digits ARGS mlp
)
inference_test
(
recognize_digits ARGS mlp
conv
)
inference_test
(
recommender_system
)
inference_test
(
recommender_system
)
#inference_test(rnn_encoder_decoder)
#inference_test(rnn_encoder_decoder)
inference_test
(
understand_sentiment
)
inference_test
(
understand_sentiment
)
...
...
paddle/fluid/inference/tests/book/test_inference_recognize_digits.cc
浏览文件 @
a040239d
...
@@ -77,7 +77,7 @@ TEST(inference, recognize_digits_combine) {
...
@@ -77,7 +77,7 @@ TEST(inference, recognize_digits_combine) {
// Use normilized image pixels as input data,
// Use normilized image pixels as input data,
// which should be in the range [-1.0, 1.0].
// which should be in the range [-1.0, 1.0].
SetupTensor
<
float
>
(
SetupTensor
<
float
>
(
input
,
{
1
,
28
,
28
},
static_cast
<
float
>
(
-
1
),
static_cast
<
float
>
(
1
));
input
,
{
1
,
1
,
28
,
28
},
static_cast
<
float
>
(
-
1
),
static_cast
<
float
>
(
1
));
std
::
vector
<
paddle
::
framework
::
LoDTensor
*>
cpu_feeds
;
std
::
vector
<
paddle
::
framework
::
LoDTensor
*>
cpu_feeds
;
cpu_feeds
.
push_back
(
&
input
);
cpu_feeds
.
push_back
(
&
input
);
...
...
python/paddle/v2/fluid/tests/book/test_recognize_digits.py
浏览文件 @
a040239d
...
@@ -141,7 +141,7 @@ def train(nn_type, use_cuda, parallel, save_dirname, save_param_filename):
...
@@ -141,7 +141,7 @@ def train(nn_type, use_cuda, parallel, save_dirname, save_param_filename):
# get test acc and loss
# get test acc and loss
acc_val
=
numpy
.
array
(
acc_set
).
mean
()
acc_val
=
numpy
.
array
(
acc_set
).
mean
()
avg_loss_val
=
numpy
.
array
(
avg_loss_set
).
mean
()
avg_loss_val
=
numpy
.
array
(
avg_loss_set
).
mean
()
if
float
(
acc_val
)
>
0.
85
:
# test acc > 85%
if
float
(
acc_val
)
>
0.
2
:
# Smaller value to increase CI speed
if
save_dirname
is
not
None
:
if
save_dirname
is
not
None
:
fluid
.
io
.
save_inference_model
(
fluid
.
io
.
save_inference_model
(
save_dirname
,
[
"img"
],
[
prediction
],
save_dirname
,
[
"img"
],
[
prediction
],
...
@@ -235,8 +235,9 @@ def inject_all_tests():
...
@@ -235,8 +235,9 @@ def inject_all_tests():
for
nn_type
in
(
'mlp'
,
'conv'
):
for
nn_type
in
(
'mlp'
,
'conv'
):
inject_test_method
(
use_cuda
,
parallel
,
nn_type
,
True
)
inject_test_method
(
use_cuda
,
parallel
,
nn_type
,
True
)
#
One
unit-test for saving parameters as separate files
#
Two
unit-test for saving parameters as separate files
inject_test_method
(
False
,
False
,
'mlp'
,
False
)
inject_test_method
(
False
,
False
,
'mlp'
,
False
)
inject_test_method
(
False
,
False
,
'conv'
,
False
)
inject_all_tests
()
inject_all_tests
()
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录