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

[doc] add ctc weight for attention rescoring & substitute batchnorm in convolution module with layernorm #19

Merged
merged 1 commit into from Dec 11, 2020

Conversation

whiteshirt0429
Copy link
Collaborator

No description provided.

@@ -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]
Copy link
Collaborator

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)
Copy link
Collaborator

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.

@@ -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
Copy link
Collaborator

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.

Copy link
Collaborator

@robin1001 robin1001 left a 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.

[network] substitute batchnorm in convolution with layernorm
@whiteshirt0429 whiteshirt0429 changed the title [doc] add ctc weight for attention rescoring [doc] add ctc weight for attention rescoring & substitute batchnorm in convolution module with layernorm Dec 11, 2020
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.

None yet

4 participants