Menu

#4 FeatureTypes class has static variable which is not reset

open-invalid
nobody
None
5
2006-07-16
2006-07-16
No

FeatureTypes class has a static variable - int offset -
which is used for assigning thisTypeId parameter proper
values. This in turn is used to generate proper
feature ids. Now, with every new instance of
FeatureGenImpl, this offset variable should be reset
to 0, otherwise it may create problems.

Consider the following case.
An application has train() and test() methods:
train() {
featureGen = new FeatureGenImpl(modelGraph, nlabels, true).
....
featureGen.write("features.txt");
}

test() {
featureGen = new FeatureGenImpl(modelGraph, nlabels, true);
featureGen.read("features.txt")
}

main() {
train();
test();
}

This code has problems as when test() is called, then
all the featureTypes will have incorrect thisTypeId
value and thus incorrect feature ids.

-amit

Discussion

  • Amit Jaiswal

    Amit Jaiswal - 2006-07-16
    • status: open --> open-invalid
     
  • Amit Jaiswal

    Amit Jaiswal - 2006-07-16

    Logged In: YES
    user_id=1283773

    This static variable was removed in CRF-1.2. This bug is
    invalid.
    -amit

     

Log in to post a comment.