MCPcopy Create free account
hub / github.com/davisking/dlib / num_nonnegative_weights

Method num_nonnegative_weights

dlib/svm/sequence_segmenter.h:47–61  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45 feature_extractor(const ss_feature_extractor& ss_fe_) : fe(ss_fe_) {}
46
47 unsigned long num_nonnegative_weights (
48 ) const
49 {
50 const unsigned long NL = ss_feature_extractor::use_BIO_model ? 3 : 5;
51 if (ss_feature_extractor::allow_negative_weights)
52 {
53 return 0;
54 }
55 else
56 {
57 // We make everything non-negative except for the label transition
58 // and bias features.
59 return num_features() - NL*NL - NL;
60 }
61 }
62
63 friend void serialize(const feature_extractor& item, std::ostream& out)
64 {

Callers 1

num_nonnegative_weightsFunction · 0.45

Calls

no outgoing calls

Tested by

no test coverage detected