diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-06-28 17:53:11 +0200 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2012-06-28 17:53:11 +0200 |
commit | abc5cf3ea5e13385b8bb8f884af1cda05f98dd70 (patch) | |
tree | d781ad897fc21333c4fc4646b8d42aea0d6681d4 | |
parent | 55cafb1189cac406aa0e5c4fc7d8fd57da69c9a4 (diff) | |
parent | b3a7f6c5d97acac3cd6b14de194eadaa18175fda (diff) |
Merge remote-tracking branch 'upstream/master'
-rwxr-xr-x | minrisk/minrisk.pl | 2 | ||||
-rw-r--r-- | minrisk/minrisk_optimize.cc | 7 |
2 files changed, 8 insertions, 1 deletions
diff --git a/minrisk/minrisk.pl b/minrisk/minrisk.pl index 99893a66..d05b9595 100755 --- a/minrisk/minrisk.pl +++ b/minrisk/minrisk.pl @@ -133,7 +133,7 @@ if ($metric =~ /^ter$|^aer$/i) { my $refs_comma_sep = get_comma_sep_refs('r',$refFiles); unless ($dir){ - $dir = "rampion"; + $dir = "minrisk"; } unless ($dir =~ /^\//){ # convert relative path to absolute path my $basedir = check_output("pwd"); diff --git a/minrisk/minrisk_optimize.cc b/minrisk/minrisk_optimize.cc index 5096acc1..6e651994 100644 --- a/minrisk/minrisk_optimize.cc +++ b/minrisk/minrisk_optimize.cc @@ -105,6 +105,13 @@ int main(int argc, char** argv) { vector<weight_t> weights; const string weightsf = conf["weights"].as<string>(); Weights::InitFromFile(weightsf, &weights); + double t = 0; + for (unsigned i = 0; i < weights.size(); ++i) + t += weights[i] * weights[i]; + if (t > 0) { + for (unsigned i = 0; i < weights.size(); ++i) + weights[i] /= sqrt(t); + } string line, file; vector<training::CandidateSet> kis; cerr << "Loading hypergraphs...\n"; |