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

Rnnt mmi #2

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Rnnt mmi #2

wants to merge 7 commits into from

Conversation

pkufool
Copy link
Owner

@pkufool pkufool commented Aug 21, 2022

No description provided.

params.simple_loss_scale * predictor_simple_loss
+ pruned_loss_scale * predictor_pruned_loss
+ params.simple_loss_scale * hybrid_simple_loss
+ mmi_loss
)
Copy link
Owner Author

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)
Copy link
Owner Author

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)
Copy link
Owner Author

@pkufool pkufool Aug 22, 2022

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,
Copy link
Owner Author

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.

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.

1 participant