summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Simianer <simianer@cl.uni-heidelberg.de>2014-02-16 01:58:50 +0100
committerPatrick Simianer <simianer@cl.uni-heidelberg.de>2014-02-16 01:58:50 +0100
commitf8283d3f58588e00c2f4887f130bc91d891ad76f (patch)
treee47ff05ffccd19273226a2dc15017fe7e68df7e0
parent0ed17a3cdf2698e868cd88881c1ba8cf99854baa (diff)
fix max==0&&min==0
-rwxr-xr-xrampfion.rb1
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