提交 5ddc79a8 编写于 作者: H Hui Zhang

fix decoder using blank_id=0

上级 ab7aa43d
...@@ -16,8 +16,8 @@ ...@@ -16,8 +16,8 @@
--- ---
Language: Cpp Language: Cpp
BasedOnStyle: Google BasedOnStyle: Google
IndentWidth: 2 IndentWidth: 4
TabWidth: 2 TabWidth: 4
ContinuationIndentWidth: 4 ContinuationIndentWidth: 4
MaxEmptyLinesToKeep: 2 MaxEmptyLinesToKeep: 2
AccessModifierOffset: -2 # The private/protected/public has no indent in class AccessModifierOffset: -2 # The private/protected/public has no indent in class
......
...@@ -40,13 +40,15 @@ std::vector<std::pair<double, std::string>> ctc_beam_search_decoder( ...@@ -40,13 +40,15 @@ std::vector<std::pair<double, std::string>> ctc_beam_search_decoder(
size_t num_time_steps = probs_seq.size(); size_t num_time_steps = probs_seq.size();
for (size_t i = 0; i < num_time_steps; ++i) { for (size_t i = 0; i < num_time_steps; ++i) {
VALID_CHECK_EQ(probs_seq[i].size(), VALID_CHECK_EQ(probs_seq[i].size(),
vocabulary.size() + 1, // vocabulary.size() + 1,
vocabulary.size(),
"The shape of probs_seq does not match with " "The shape of probs_seq does not match with "
"the shape of the vocabulary"); "the shape of the vocabulary");
} }
// assign blank id // assign blank id
size_t blank_id = vocabulary.size(); //size_t blank_id = vocabulary.size();
size_t blank_id = 0;
// assign space id // assign space id
auto it = std::find(vocabulary.begin(), vocabulary.end(), " "); auto it = std::find(vocabulary.begin(), vocabulary.end(), " ");
......
文件模式从 100644 更改为 100755
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册