diff options
author | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2014-02-16 01:58:50 +0100 |
---|---|---|
committer | Patrick Simianer <simianer@cl.uni-heidelberg.de> | 2014-02-16 01:58:50 +0100 |
commit | f8283d3f58588e00c2f4887f130bc91d891ad76f (patch) | |
tree | e47ff05ffccd19273226a2dc15017fe7e68df7e0 | |
parent | 0ed17a3cdf2698e868cd88881c1ba8cf99854baa (diff) |
fix max==0&&min==0
-rwxr-xr-x | rampfion.rb | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/rampfion.rb b/rampfion.rb index 479ca2b..23bedcb 100755 --- a/rampfion.rb +++ b/rampfion.rb @@ -67,6 +67,7 @@ end def adjust_model_scores kbest, factor min = kbest.map{ |k| k.scores[:decoder] }.min max = kbest.map{ |k| k.scores[:decoder] }.max + return if min==0&&max==0 kbest.each { |k| k.scores[:decoder] = factor*((k.scores[:decoder]-min)/(max-min)) } end |