From b31708e1066ff699c7c06d1edb7c8223b84d62cd Mon Sep 17 00:00:00 2001
From: Patrick Simianer
Date: Sun, 1 Feb 2015 19:56:17 +0100
Subject: dtrain: rm fix_features
---
training/dtrain/dtrain.cc | 21 +++------------------
1 file changed, 3 insertions(+), 18 deletions(-)
(limited to 'training/dtrain')
diff --git a/training/dtrain/dtrain.cc b/training/dtrain/dtrain.cc
index 4c5972a1..64fbf80d 100644
--- a/training/dtrain/dtrain.cc
+++ b/training/dtrain/dtrain.cc
@@ -43,7 +43,6 @@ dtrain_init(int argc, char** argv, po::variables_map* conf)
("repeat", po::value()->default_value(1), "repeat optimization over kbest list this number of times")
("check", po::value()->zero_tokens(), "produce list of loss differentials")
("output_ranking", po::value()->default_value(""), "Output kbests with model scores and metric per iteration to this folder.")
- ("fix_features", po::value()->zero_tokens(), "Ignore all features that are not in input_weights.")
("noup", po::value()->zero_tokens(), "do not update weights");
po::options_description cl("Command Line Options");
cl.add_options()
@@ -112,12 +111,10 @@ main(int argc, char** argv)
if (conf.count("verbose")) verbose = true;
bool noup = false;
if (conf.count("noup")) noup = true;
- bool rescale = false;
- if (conf.count("rescale")) rescale = true;
bool keep = false;
if (conf.count("keep")) keep = true;
- bool fix_features = false;
- if (conf.count("fix_features")) fix_features = true;
+ bool rescale = false;
+ if (conf.count("rescale")) rescale = true;
const unsigned k = conf["k"].as();
const unsigned N = conf["N"].as();
@@ -196,16 +193,8 @@ main(int argc, char** argv)
vector& decoder_weights = decoder.CurrentWeightVector();
SparseVector lambdas, cumulative_penalties, w_average, fixed;
- if (conf.count("input_weights")) {
+ if (conf.count("input_weights"))
Weights::InitFromFile(conf["input_weights"].as(), &decoder_weights);
- if (fix_features) {
- Weights::InitSparseVector(decoder_weights, &fixed);
- SparseVector::iterator it = fixed.begin();
- for (; it != fixed.end(); ++it) {
- it->second = 1.0;
- }
- }
- }
Weights::InitSparseVector(decoder_weights, &lambdas);
// meta params for perceptron, SVM
@@ -344,8 +333,6 @@ main(int argc, char** argv)
if (next || stop) break;
// weights
- if (fix_features)
- lambdas.cw_mult(fixed);
lambdas.init_vector(&decoder_weights);
// getting input
@@ -657,8 +644,6 @@ main(int argc, char** argv)
// write weights to file
if (select_weights == "best" || keep) {
- if (fix_features)
- lambdas.cw_mult(fixed);
lambdas.init_vector(&decoder_weights);
string w_fn = "weights." + boost::lexical_cast(t) + ".gz";
Weights::WriteToFile(w_fn, decoder_weights, true);
--
cgit v1.2.3