10 #ifndef META_SEQUENCE_CRF_H_
11 #define META_SEQUENCE_CRF_H_
27 MAKE_NUMERIC_IDENTIFIER(crf_feature_id, uint64_t)
87 uint64_t max_iters = 1000;
93 double calibration_eta = 0.1;
98 double calibration_rate = 2.0;
103 uint64_t calibration_samples = 1000;
109 uint64_t calibration_trials = 10;
126 crf(
const std::string& prefix);
137 double train(
parameters params,
const std::vector<sequence>& examples);
145 tagger make_tagger()
const;
150 uint64_t num_labels()
const;
179 void initialize(
const std::vector<sequence>& examples);
202 double calibrate(
parameters params,
const std::vector<uint64_t>& indices,
203 const std::vector<sequence>& examples);
209 const double& obs_weight(crf_feature_id idx)
const;
215 double& obs_weight(crf_feature_id idx);
221 const double& trans_weight(crf_feature_id idx)
const;
227 double& trans_weight(crf_feature_id idx);
254 label_id transition(crf_feature_id idx)
const;
268 uint64_t iter,
const std::vector<uint64_t>& indices,
291 void gradient_observation_expectation(
const sequence& seq,
double gain);
302 void gradient_model_expectation(
const sequence& seq,
double gain,
308 double l2norm()
const;