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 ...@@ -55,8 +55,8 @@ namespace dlib
else else
{ {
// We make everything non-negative except for the label transition // We make everything non-negative except for the label transition
// features. // and bias features.
return num_features() - NL*NL; return num_features() - NL*NL - NL;
} }
} }
......
...@@ -190,11 +190,11 @@ namespace dlib ...@@ -190,11 +190,11 @@ namespace dlib
// the previous label. // the previous label.
const static bool use_high_order_features = true; const static bool use_high_order_features = true;
// You use a tool like the structural_sequence_segmentation_trainer to learn the // You use a tool like the structural_sequence_segmentation_trainer to learn the weight
// weight vector needed by a sequence_segmenter. You can tell the trainer to force // vector needed by a sequence_segmenter. You can tell the trainer to force all the
// all the elements of the weight vector corresponding to ZI() to be non-negative. // elements of the weight vector corresponding to ZI() to be non-negative. This is all
// This is all the elements of w except for the elements corresponding to the label // the elements of w except for the elements corresponding to the label transition and
// transition indicator features. To do this, just set allow_negative_weights to false. // bias indicator features. To do this, just set allow_negative_weights to false.
const static bool allow_negative_weights = true; const static bool allow_negative_weights = true;
......
...@@ -243,9 +243,9 @@ namespace ...@@ -243,9 +243,9 @@ namespace
long N; long N;
if (use_BIO_model) if (use_BIO_model)
N = 3*3; N = 3*3+3;
else 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_normal_weight = min(colm(labeler2.get_weights(), 0, labeler2.get_weights().size()-N));
const double min_trans_weight = min(labeler2.get_weights()); const double min_trans_weight = min(labeler2.get_weights());
dlog << LINFO << "min_normal_weight: " << min_normal_weight; 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