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

Add emission class for Categorical distributions #77

Merged
merged 4 commits into from
Jul 8, 2024

Conversation

ThomasColthurst
Copy link
Collaborator

A later pull request will have the upgrades to the Sometimes emissions adapter that will let it be used in conjunction with this.

Copy link
Collaborator

@emilyfertig emilyfertig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have a question about logp, otherwise looks good!

if (std::cmp_equal(i, x.first)) {
lp += emission_dists[i].logp(x.second);
} else {
lp += emission_dists[i].logp_score();
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you explain this formula for logp? I thought it should be p(x.second | x.first), where x.first is clean and x.second is noisy, such that the conditional probability in the if branch was all we needed. Also, to the extent that this is like a bigram model, the bigram logp doesn't contain logp_score terms for the rest of the categories.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are entirely correct; this should only contain the conditional probability. Fixed.

Copy link
Collaborator

@emilyfertig emilyfertig left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LG!

@ThomasColthurst ThomasColthurst merged commit dc81c54 into master Jul 8, 2024
1 of 2 checks passed
@ThomasColthurst ThomasColthurst deleted the 070824-thomaswc-catemission branch July 8, 2024 20:00
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.

2 participants