-
Notifications
You must be signed in to change notification settings - Fork 2
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
Conversation
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 have a question about logp, otherwise looks good!
cxx/emissions/categorical.hh
Outdated
if (std::cmp_equal(i, x.first)) { | ||
lp += emission_dists[i].logp(x.second); | ||
} else { | ||
lp += emission_dists[i].logp_score(); |
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.
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.
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.
You are entirely correct; this should only contain the conditional probability. Fixed.
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.
Thanks, LG!
A later pull request will have the upgrades to the Sometimes emissions adapter that will let it be used in conjunction with this.