Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

【PaddlePaddle Hackathon】47. Add test of nn.dynamic_decode v0.1 #330

Merged
merged 14 commits into from
Nov 15, 2021
Merged

【PaddlePaddle Hackathon】47. Add test of nn.dynamic_decode v0.1 #330

merged 14 commits into from
Nov 15, 2021

Conversation

jellyman2187
Copy link
Contributor

Add test of nn.dynamic_decode v0.1

@jellyman2187 jellyman2187 changed the title Add test of nn.dynamic_decode v0.1 【PaddlePaddle Hackathon】47. Add test of nn.dynamic_decode v0.1 Nov 9, 2021
@jellyman2187
Copy link
Contributor Author

@kolinwei

if error in e.args[0]:
pass
else:
raise Exception
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

补充如下case
1、dynamic_decode的decoder参数试试可不可以是另一个dynamic_decode。
2、inits的size和decoder不匹配时
3、is_test=False, return_length=False这两个参数的测试。

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

第一条好像不太行呀,dynamic_decode是整个解码过程的入口,需要传入的参数就是Decoder的一个实例,他是动态调用Decoder的step函数按步执行decode,但是dynamic_decode就是个解码函数,并没有step函数,本身就不是个解码器呀

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

已更新

2.新增is_test=False, return_length=False这两个参数的测试
2.新增is_test=False, return_length=False这两个参数的测试
kolinwei
kolinwei previously approved these changes Nov 11, 2021
Copy link
Collaborator

@DDDivano DDDivano left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

可以参考下我们对您之前提的 beamsearch的修改,改一下测试代码。主要原因如下:
通过固定seed算出的结果,会在不同硬件条件&系统下出现不同的结果,这样会存在其他环境挂Case的情况。由于beamsearchdecode内部包含topk操作,通过赋值Constant初始化也会存在topk分数一致随机排序的情况,无法固定结果。所以最终选择在某一环境下保存参数模型,通过saveload的方式保证结果的一致性,请参考https://github.com/PaddlePaddle/PaddleTest/pull/332/files 修改。会存在提交模型参数文件过不了Codestyle安全检测的情况,后续会予以豁免。

jellyman2187 and others added 7 commits November 12, 2021 00:21
# Conflicts:
#	framework/api/nn/model/model_grucell5
#	framework/api/nn/model/model_grucell6
#	framework/api/nn/model/model_lstmcell1
#	framework/api/nn/model/model_lstmcell2
#	framework/api/nn/test_dynamicdecode.py
@jellyman2187
Copy link
Contributor Author

@DDDivano 已更新

@TCChenlong
Copy link

@ZS-Yan 有个CI挂了 需要处理下哈~

@jellyman2187
Copy link
Contributor Author

@TCChenlong 你好,之前参考了 DDDivano 的建议修改了测试代码,他说会存在提交模型参数文件过不了Codestyle安全检测的情况,后续会予以豁免。

@DDDivano DDDivano merged commit 8318aba into PaddlePaddle:develop Nov 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants