Skip to content

Commit

Permalink
Merge branch 'develop' into ctcdecoders
Browse files Browse the repository at this point in the history
  • Loading branch information
Jackwaterveg committed Jan 20, 2022
2 parents fe09329 + 2082b89 commit 181eb62
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 9 deletions.
4 changes: 2 additions & 2 deletions examples/aishell/asr0/conf/tuning/chunk_decode.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
chunk_batch_size: 32
decode_batch_size: 32
error_rate_type: cer
decoding_method: ctc_beam_search
lang_model_path: data/lm/zh_giga.no_cna_cmn.prune01244.klm
alpha: 2.2 #1.9
beta: 4.3
beam_size: 300
beam_size: 500
cutoff_prob: 0.99
cutoff_top_n: 40
num_proc_bsearch: 10
5 changes: 1 addition & 4 deletions third_party/ctc_decoders/ctc_beam_search_decoder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -474,13 +474,10 @@ CtcBeamSearchDecoderBatch::CtcBeamSearchDecoderBatch(
ext_scorer(ext_scorer),
blank_id(blank_id) {
this->vocabulary = vocabulary;
// this->decoder_storage_vector.reserve(batch_size);
for (size_t i = 0; i < batch_size; i++) {
this->decoder_storage_vector.push_back(
std::unique_ptr<CtcBeamSearchDecoderStorage>(
new CtcBeamSearchDecoderStorage(beam_size)));
// this->decoder_storage_vector.emplace_back(new
// CtcBeamSearchDecoderStorage());
new CtcBeamSearchDecoderStorage()));
ctc_beam_search_decode_chunk_begin(
this->decoder_storage_vector[i]->root, ext_scorer);
}
Expand Down
4 changes: 1 addition & 3 deletions third_party/ctc_decoders/ctc_beam_search_decoder.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,10 @@ ctc_beam_search_decoder_batch(

class CtcBeamSearchDecoderStorage {
public:
size_t beam_size=-1;
PathTrie *root = nullptr;
std::vector<PathTrie *> prefixes;

CtcBeamSearchDecoderStorage(size_t beam_size) {
this->beam_size = beam_size;
CtcBeamSearchDecoderStorage() {
// init prefixes' root
this->root = new PathTrie();
this->root->log_prob_b_prev = 0.0;
Expand Down

0 comments on commit 181eb62

Please sign in to comment.