diff options
author | Patrick Simianer <p@simianer.de> | 2016-01-29 18:18:03 +0100 |
---|---|---|
committer | Patrick Simianer <p@simianer.de> | 2016-01-29 18:18:03 +0100 |
commit | 72aa78cbfa4e35a117af3a7f9837d817d16d8fc8 (patch) | |
tree | dd0669ccb7c6d27d9b875c930081775ce85612a3 /util | |
parent | 7d35b712d33cca0be3af122ecffbbfa7cbc123b2 (diff) |
cleanup
Diffstat (limited to 'util')
-rwxr-xr-x | util/convlr.rb | 28 |
1 files changed, 0 insertions, 28 deletions
diff --git a/util/convlr.rb b/util/convlr.rb deleted file mode 100755 index c845847..0000000 --- a/util/convlr.rb +++ /dev/null @@ -1,28 +0,0 @@ -#!/usr/bin/env ruby - -require 'zipf' - -updates = SparseVector.new -ReadFile.readlines_strip(ARGV[0]).each { |line| - k,v = line.split - updates[k] = v.to_f -} -grads = SparseVector.new -ReadFile.readlines_strip(ARGV[1]).each { |line| - k,v = line.split - grads[k] = v.to_f -} - -smooth = 0.000001 - -ks = updates.keys + grads.keys - -rates = SparseVector.new -ks.each { |k| - rates[k] = Math.sqrt(updates[k]+smooth)/Math.sqrt(grads[k]+smooth) -} - -rates.each { |k,v| - puts "#{k} #{v}" -} - |