From 78feac4ca2c9a32710985dc0295c24d418712009 Mon Sep 17 00:00:00 2001 From: txh18 Date: Sun, 25 Oct 2015 22:33:04 +0800 Subject: added timer for profiling --- nerv/examples/lmptb/main.lua | 2 +- nerv/nn/layer_dag.lua | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/nerv/examples/lmptb/main.lua b/nerv/examples/lmptb/main.lua index 74ce407..9b39e83 100644 --- a/nerv/examples/lmptb/main.lua +++ b/nerv/examples/lmptb/main.lua @@ -268,7 +268,7 @@ if (set == "ptb") then hidden_size = 200, batch_size = 10, - bptt = 6, --train bptt_block's words. could be set to zero + bptt = 3, --train bptt_block's words. could be set to zero max_iter = 18, param_random = function() return (math.random() / 5 - 0.1) end, independent = true, diff --git a/nerv/nn/layer_dag.lua b/nerv/nn/layer_dag.lua index 73bb77d..91818d6 100644 --- a/nerv/nn/layer_dag.lua +++ b/nerv/nn/layer_dag.lua @@ -262,7 +262,9 @@ function DAGLayer:propagate(input, output) for i = 1, #self.queue do local ref = self.queue[i] -- print(ref.layer.id) + self.gconf.timer:tic("(propagate)"..ref.layer.id); ret = ref.layer:propagate(ref.inputs, ref.outputs) + self.gconf.timer:toc("(propagate)"..ref.layer.id); end return ret end -- cgit v1.2.3-70-g09d2