-
Notifications
You must be signed in to change notification settings - Fork 0
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
Rnnt mmi #2
base: master
Are you sure you want to change the base?
Conversation
params.simple_loss_scale * predictor_simple_loss | ||
+ pruned_loss_scale * predictor_pruned_loss | ||
+ params.simple_loss_scale * hybrid_simple_loss | ||
+ mmi_loss | ||
) |
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.
I gradully added predictor_simple_loss, hybrid_simple_loss, predictor_pruned_loss, num_loss (i.e. hybrid_pruned_loss) , den_loss one by one.
|
||
probs = torch.softmax(predictor_joiner_output, -1) | ||
# sampler: https://pytorch.org/docs/stable/distributions.html#categorical | ||
sampler = Categorical(probs=probs) |
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.
I used torch.distributions.categorical.Categorical
to sample symbols according to the predictor_joiner_output.
lm_scores.masked_fill_(mask=t_mask.unsqueeze(2), value=0.0) | ||
# detach lm_scoers, we only train external_lm module with NUM loss | ||
path_scores = hybrid_scores + lm_scores.detach() | ||
path_scores_list.append(path_scores) |
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.
Nenural lm scores were added to lattice here.
ranges=ranges, | ||
termination_symbol=blank_id, | ||
boundary=boundary, | ||
external_lm=external_lm_out_proj, |
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.
The neural lm scores were added to num_loss
here, it will add to px
matrix after a gather operation.
No description provided.