简体   繁体   English

返回的BeamSearch解码代码库

[英]BeamSearch decoding codebase in returnn

This config has example use of adding lm_score with posterior from ctc or seq2seq model https://github.com/rwth-i6/returnn-experiments/blob/master/2018-asr-attention/librispeech/attention/exp3.ctc.lm.config 此配置示例使用了从ctc或seq2seq模型向后添加lm_score的示例用法https://github.com/rwth-i6/returnn-experiments/blob/master/2018-asr-attention/librispeech/attention/exp3.ctc.lm的.config

I would like to know how the it is used during beam search decoding. 我想知道在波束搜索解码中如何使用它。 I am not able to find the BeamSearch decoding example ? 我找不到BeamSearch解码示例吗? Pointer to that code which implements it would be useful. 指向实现它的代码的指针将很有用。

The config describes the model, and some hyper params for training and/or decoding. 该配置描述了模型,以及一些用于训练和/或解码的超级参数。

The actual code for performing training and/or decoding is in Returnn itself. 执行训练和/或解码的实际代码在Returnn本身中。 See the full setup as an example how to call Returnn to perform the beam search. 请参阅完整设置作为示例,说明如何调用Returnn进行光束搜索。

In Returnn, very briefly, the beam search is implemented with pure TF functions, so it will run inside the TF computation graph. 很简单,在Returnn中,波束搜索是通过纯TF函数实现的,因此它将在TF计算图中运行。 When building the computation graph for the model, there is the search_flag which says that search should be performed. 在为模型构建计算图时,有search_flag表示应该执行搜索。 There is the ChoiceLayer which will expand the search beam via tf.topk in case the search_flag is set. 如果设置了search_flagChoiceLayer将通过tf.topk扩展搜索范围。 Setting this up and executing the computation graph happens in TFEngine in the search function. TFEnginesearch功能中进行设置并执行计算图。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM