diff options
author | Chris Dyer <cdyer@cs.cmu.edu> | 2011-03-17 22:46:35 -0400 |
---|---|---|
committer | Chris Dyer <cdyer@cs.cmu.edu> | 2011-03-17 22:46:35 -0400 |
commit | f8f499c69cba280894d1ddf974a9038ac2211fc6 (patch) | |
tree | 6f835eb7675b205324920e5cef17c3a06b9d5ff8 /training/mpi_online_optimize.cc | |
parent | b6e699cb65f3f6e603434a7e702f8d46df4881ec (diff) |
freeze features, including penalty
Diffstat (limited to 'training/mpi_online_optimize.cc')
-rw-r--r-- | training/mpi_online_optimize.cc | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/training/mpi_online_optimize.cc b/training/mpi_online_optimize.cc index 1367581a..32033c19 100644 --- a/training/mpi_online_optimize.cc +++ b/training/mpi_online_optimize.cc @@ -299,7 +299,7 @@ int main(int argc, char** argv) { const string omethod = conf["optimization_method"].as<string>(); if (omethod == "sgd") { const double C = conf["regularization_strength"].as<double>(); - o.reset(new CumulativeL1OnlineOptimizer(lr, total_corpus_size, C)); + o.reset(new CumulativeL1OnlineOptimizer(lr, total_corpus_size, C, frozen_fids)); } else { assert(!"fail"); } @@ -377,8 +377,6 @@ int main(int argc, char** argv) { g.swap(local_grad); #endif local_grad.clear(); - for (int i = 0; i < frozen_fids.size(); ++i) - g.erase(frozen_fids[i]); if (rank == 0) { g /= (size_per_proc * size); o->UpdateWeights(g, FD::NumFeats(), &x); |