diff options
Diffstat (limited to 'training')
| -rw-r--r-- | training/latent_svm/latent_svm.cc | 13 | ||||
| -rw-r--r-- | training/mira/kbest_cut_mira.cc | 7 | ||||
| -rw-r--r-- | training/utils/candidate_set.cc | 2 | 
3 files changed, 7 insertions, 15 deletions
| diff --git a/training/latent_svm/latent_svm.cc b/training/latent_svm/latent_svm.cc index ab9c1d5d..60e52550 100644 --- a/training/latent_svm/latent_svm.cc +++ b/training/latent_svm/latent_svm.cc @@ -32,7 +32,6 @@ total_loss and prev_loss actually refer not to loss, but the metric (usually BLE  #include "sampler.h"  using namespace std; -using boost::shared_ptr;  namespace po = boost::program_options;  bool invert_score;  @@ -128,7 +127,7 @@ struct HypothesisInfo {  };  struct GoodOracle { -  shared_ptr<HypothesisInfo> good; +  boost::shared_ptr<HypothesisInfo> good;  };  struct TrainingObserver : public DecoderObserver { @@ -143,9 +142,9 @@ struct TrainingObserver : public DecoderObserver {    const DocScorer& ds;    const vector<weight_t>& feature_weights;    vector<GoodOracle>& oracles; -  shared_ptr<HypothesisInfo> cur_best; -  shared_ptr<HypothesisInfo> cur_costaug_best; -  shared_ptr<HypothesisInfo> cur_ref;  +  boost::shared_ptr<HypothesisInfo> cur_best; +  boost::shared_ptr<HypothesisInfo> cur_costaug_best; +  boost::shared_ptr<HypothesisInfo> cur_ref;     const int kbest_size;    const double mt_metric_scale;    const double mu; @@ -168,8 +167,8 @@ struct TrainingObserver : public DecoderObserver {      UpdateOracles(smeta.GetSentenceID(), *hg);    } -  shared_ptr<HypothesisInfo> MakeHypothesisInfo(const SparseVector<double>& feats, const double metric) { -    shared_ptr<HypothesisInfo> h(new HypothesisInfo); +  boost::shared_ptr<HypothesisInfo> MakeHypothesisInfo(const SparseVector<double>& feats, const double metric) { +    boost::shared_ptr<HypothesisInfo> h(new HypothesisInfo);      h->features = feats;      h->mt_metric_score = metric;      return h; diff --git a/training/mira/kbest_cut_mira.cc b/training/mira/kbest_cut_mira.cc index 3b1108e0..990609d7 100644 --- a/training/mira/kbest_cut_mira.cc +++ b/training/mira/kbest_cut_mira.cc @@ -49,13 +49,6 @@ bool sent_approx;  bool checkloss;  bool stream; -void SanityCheck(const vector<double>& w) { -  for (int i = 0; i < w.size(); ++i) { -    assert(!isnan(w[i])); -    assert(!isinf(w[i])); -  } -} -  struct FComp {    const vector<double>& w_;    FComp(const vector<double>& w) : w_(w) {} diff --git a/training/utils/candidate_set.cc b/training/utils/candidate_set.cc index 1dec9609..33dae9a3 100644 --- a/training/utils/candidate_set.cc +++ b/training/utils/candidate_set.cc @@ -1,6 +1,6 @@  #include "candidate_set.h" -#ifdef HAVE_CXX11 +#ifndef HAVE_OLD_CPP  # include <unordered_set>  #else  # include <tr1/unordered_set> | 
