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

ACRF-example-fixes #24

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

Conversation

steveash
Copy link

Bugfix for ACRF when there is only one timeslice; also fix a few errors in the example code

assert var1 != null : "Couldn't get label factor "+lvl1+" time "+t;
assert var2 != null : "Couldn't get label factor "+lvl2+" time "+(t+1);
protected void addInstantiatedCliques(ACRF.UnrolledGraph graph, FeatureVectorSequence fvs, LabelsAssignment lblseq) {
for (int t = 0; t < lblseq.maxTime() - 1; t++) {
Copy link
Author

Choose a reason for hiding this comment

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

should be looping over maxTime -- not over size()

@casutton
Copy link
Collaborator

casutton commented Mar 2, 2015

Thanks! I'd be keen in merge in the change to CrossTemplate1.java, but I'm not so sure about the change to ACRF.java. The issue is that much of the time BigramTemplate is used in conjunction with UnigramTemplate for statistical reasons, because the unigram features provide a form of backoff to the bigram features. (This is probably why I hadn't noticed this issue earlier.)

But if you use this version of BigramTemplate along with UnigramTemplate, then for instances with only one time slice, you would get two redundant unigram factors with different parameters. This behaviour could be confusing and maybe even lead to the model overfitting.

Maybe the cleanest way to handle this is to create a template whose job is to put a unary factor only on the first labels vector in the sequence. This would fix the corner case, and also would be generally useful, as even if you are using Bigrams and Unigrams, having this behaviour is useful. Would be good to have this in a separate template so that it can be plugged in different ways. Would you have time to modify the patch accordingly?

@casutton casutton self-assigned this Mar 2, 2015
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