From 266b88a783d5af777fb54543851e5f50b89b3170 Mon Sep 17 00:00:00 2001 From: Patrick Simianer Date: Fri, 4 Aug 2017 16:16:30 +0200 Subject: debug --- src/recurrent.js | 35 +++++++++++++++++++++++++++-------- 1 file changed, 27 insertions(+), 8 deletions(-) (limited to 'src/recurrent.js') diff --git a/src/recurrent.js b/src/recurrent.js index 4c20a39..4b2846b 100644 --- a/src/recurrent.js +++ b/src/recurrent.js @@ -116,7 +116,20 @@ var R = {}; // the Recurrent library Graph.prototype = { backward: function() { for(var i=this.backprop.length-1;i>=0;i--) { - this.backprop[i](); // tick! + var debug = false; + if (this.backprop[i]["mark"] == "encoder") { + debug=true; + break; + } + this.backprop[i](debug); // tick! + } + }, + backward1: function() { + for(var i=this.backprop.length-1;i>=0;i--) { + var debug = false; + if (this.backprop[i]["mark"]) debug=true; + if (this.backprop[i]["mark"] != "encoder") continue; + this.backprop[i](debug); // tick! } }, rowPluck: function(m, ix) { @@ -127,7 +140,7 @@ var R = {}; // the Recurrent library for(var i=0,n=d;i 0 ? out.dw[i] : 0.0; } @@ -208,7 +221,7 @@ var R = {}; // the Recurrent library } if(this.needs_backprop) { - var backward = function() { + var backward = function(debug=false) { for(var i=0;i