From 8473f8ba4ee5f46f2f41f397e5be9d2c04e6e7d2 Mon Sep 17 00:00:00 2001 From: Patrick Simianer
Date: Fri, 26 Jun 2015 15:21:55 +0200
Subject: debug view
---
views/debug.haml | 50 +++++++++++++++++++++++++++++++++++++-------------
1 file changed, 37 insertions(+), 13 deletions(-)
diff --git a/views/debug.haml b/views/debug.haml
index 8dcac13..fc5629b 100644
--- a/views/debug.haml
+++ b/views/debug.haml
@@ -5,7 +5,20 @@
%title debug view (for session ##{session_key})
%link(rel="stylesheet" type="text/css" href="debug.css")
%body
- %h1 debug view (for session ##{session_key})
+ %h1 debug view
+ %p (for session ##{session_key})
+ %p
+ %a{:href => "/reset", :target => "_blank"} reset progress,
+ %a{:href => "/reset_weights", :target => "_blank"} reset weights,
+ %a{:href => "/shutdown", :target => "_blank"} shutdown,
+ %span learning rate
+ %select
+ - [1000,100,10,1,0.1,0.01,0.001,0.0001,0.00001,0.000001].each do |i|
+ %option{:value => i, :onclick => "window.open(\"http://\"+window.location.host+\"/set_learning_rate/#{i}\");"} #{i}
+ %span , learning rate (sparse)
+ %select
+ - [1000,100,10,1,0.1,0.01,0.001,0.0001,0.00001,0.000001].each do |i|
+ %option{:value => i, :onclick => "window.open(\"http://\"+window.location.host+\"/set_sparse_learning_rate/#{i}\");"} #{i}
%table
%tr
%td.noborder
@@ -28,6 +41,7 @@
%p number of updates: #{data["num_up"]}
%p updated features: #{data["updated_features"]}
%p learning rate: #{data["learning_rate"]}
+ %p learning rate (sparse): #{data["learning_rate_sparse"]}
%h2 k-best
%p bleu | model score | original rank | \|e\| | translation \n features
%p.red update needed
@@ -40,11 +54,11 @@
-if b
%li.red
%strong #{"%.2f"%(k[0].to_f*100)} | #{k[1]} | #{k[2]} | #{k[4].split.size} |#{k[4]}
- %pre #{k[3]}
+ %p{:style=>"font-size:80%"} #{k[3]}
- else
%li
%strong #{"%.2f"%(k[0].to_f*100)} | #{k[1]} | #{k[2]} | #{k[4].split.size} | #{k[4]}
- %pre #{k[3]}
+ %p{:style=>"font-size:80%"} #{k[3]}
- if [9,89].include? j
%hr
%h2 weight updates
@@ -55,41 +69,48 @@
%th after
%th diff
%th raw diff
+ - data["weights_before"].default = 0
- data["weights_after"].keys.each.sort { |a,b| a[0] <=> b[0] }.each do |k|
%tr
%td.noborder #{k}
%td #{"%+.3f"%data["weights_before"][k].round(4)}
%td #{"%+.3f"%data["weights_after"][k].round(4)}
- - diff = data["weights_before"][k].abs-data["weights_after"][k].abs
+ - diff = data["weights_after"][k]-data["weights_before"][k]
- if diff < 0
%td.red #{"%+.3f"%(diff).round(4)}
- elsif diff > 0
%td.green #{"%+.3f"%(diff).round(4)}
- else
%td #{"%+.3f"%(diff).round(4)}
- %td #{"%+.1f"%((data["weights_before"][k].abs-data["weights_after"][k].abs)/data["learning_rate"]).round(2)}
+ - if !k.start_with? "R:"
+ %td #{"%+.1f"%((data["weights_after"][k]-data["weights_before"][k])/data["learning_rate"]).round(2)}
+ - else
+ %td #{"%+.1f"%((data["weights_after"][k]-data["weights_before"][k])/data["learning_rate_sparse"]).round(2)}
%h3 dense features explained
%table
%tr
%td.noborder EgivenFCoherent (TM)
%td.left -log10[ c(e, f) / sample c(f) ]
%tr
- %td.noborder Glue (per edge/rule) (dyn)
- %td.left absolute count of used rules from glue grammar
+ %td.noborder Glue
+ %td.left absolute number of rules used from glue grammar
%tr
- %td.noborder IsSingletonF/E (per edge/rule) (TM)
+ %td.noborder IsSingletonF/E (TM)
%td.left true|false (1|0) (sum)
%tr
- %td.noborder IsSingletonFE (per edge/rule) (TM)
+ %td.noborder IsSingletonFE (TM)
%td.left true|false (1|0) (sum)
%tr
%td.noborder LanguageModel
%td.left -log?[ score ]
%tr
- %td.noborder MaxLexFgivenE
+ %td.noborder LanguageModel_OOV
+ %td.left abs. count of OOV unigrams
+ %tr
+ %td.noborder MaxLexFgivenE (TM)
%td.left Sum_f -log10(maxScore) (maxScore = max_e(ttable(f))
%tr
- %td.noborder MaxLexEgivenF
+ %td.noborder MaxLexEgivenF (TM)
%td.left Sum_e -log10(maxScore) (maxScore = max_f(ttable(e))
%tr
%td.noborder PassThrough
@@ -98,9 +119,12 @@
%td.noborder SampleCountF
%td.left log10 [ sample c(f) ]
%tr
- %td.noborder WordPenalty (per edge/rule) (dyn)
+ %td.noborder WordPenalty
%td.left log_10(e)*|e| = 1/log(10) * |e| (*-1) = -0.43429448190325176*|e|
%tr
- %td.noborder SourceWordPenalty (per edge/rule) (dyn)
+ %td.noborder SourceWordPenalty (per edge/rule)
%td.left ^^^ (|e| <=> |f|)
+ %tr
+ %td.noborder R:*
+ %td.left rule indicator features, sum over full derivation per rule
--
cgit v1.2.3