Commit 6e2a867a authored by Davis King's avatar Davis King

In a recent commit I added per label bias features but forgot to exclude them

from the non-negative feature learning range.  This change fixes that.
parent 6989e96f
......@@ -55,8 +55,8 @@ namespace dlib
else
{
// We make everything non-negative except for the label transition
// features.
return num_features() - NL*NL;
// and bias features.
return num_features() - NL*NL - NL;
}
}
......
......@@ -190,11 +190,11 @@ namespace dlib
// the previous label.
const static bool use_high_order_features = true;
// You use a tool like the structural_sequence_segmentation_trainer to learn the
// weight vector needed by a sequence_segmenter. You can tell the trainer to force
// all the elements of the weight vector corresponding to ZI() to be non-negative.
// This is all the elements of w except for the elements corresponding to the label
// transition indicator features. To do this, just set allow_negative_weights to false.
// You use a tool like the structural_sequence_segmentation_trainer to learn the weight
// vector needed by a sequence_segmenter. You can tell the trainer to force all the
// elements of the weight vector corresponding to ZI() to be non-negative. This is all
// the elements of w except for the elements corresponding to the label transition and
// bias indicator features. To do this, just set allow_negative_weights to false.
const static bool allow_negative_weights = true;
......
......@@ -243,9 +243,9 @@ namespace
long N;
if (use_BIO_model)
N = 3*3;
N = 3*3+3;
else
N = 5*5;
N = 5*5+5;
const double min_normal_weight = min(colm(labeler2.get_weights(), 0, labeler2.get_weights().size()-N));
const double min_trans_weight = min(labeler2.get_weights());
dlog << LINFO << "min_normal_weight: " << min_normal_weight;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment