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
[doc] add ctc weight for attention rescoring & substitute batchnorm in convolution module with layernorm #19
Conversation
b633735
to
ca4ffba
Compare
wenet/transformer/asr_model.py
Outdated
@@ -417,6 +419,9 @@ def attention_rescoring(self, | |||
for j, w in enumerate(hyp): | |||
score += decoder_out[i][j][w] | |||
score += decoder_out[i][len(hyp)][self.eos] | |||
# add ctc score | |||
score += log_add([cur_hyps[i][1][0], cur_hyps[i][1][1] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
put log_add in _ctc_prefix_beam_search
@@ -56,7 +56,7 @@ def __init__(self, | |||
groups=channels, | |||
bias=bias, | |||
) | |||
self.norm = nn.BatchNorm1d(channels) | |||
self.norm = nn.LayerNorm(channels) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
modify your commit message to cover this change or change it in a pull request.
wenet/transformer/asr_model.py
Outdated
@@ -332,7 +332,7 @@ def _ctc_prefix_beam_search( | |||
reverse=True) | |||
cur_hyps = next_hyps[:beam_size] | |||
hyps = [x[0] for x in cur_hyps] | |||
return hyps, encoder_out | |||
return hyps, encoder_out, cur_hyps |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hyps shares the same info with cur_hyps, it's better we return hyps with it's corresponding total score here. The return is like List[(hyp, score)], encoder_out.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see the comment inline.
ca4ffba
to
cc8e792
Compare
[network] substitute batchnorm in convolution with layernorm
cc8e792
to
d1fbef6
Compare
…in convolution with layernorm(#19) [network] substitute batchnorm in convolution with layernorm
No description provided.