aboutsummaryrefslogtreecommitdiff
path: root/nerv/examples
diff options
context:
space:
mode:
authorQi Liu <liuq901@163.com>2016-03-15 13:17:45 +0800
committerQi Liu <liuq901@163.com>2016-03-15 13:17:45 +0800
commitb547dd2a30e91ce124d50f763997070ea67c6f7e (patch)
treee6f77044f68fd14b3c58b8bcda5ce84d84e96f62 /nerv/examples
parent3dd235c8b6ea7ef275381866d11d1be828d27a06 (diff)
add mask on softmax_ce
Diffstat (limited to 'nerv/examples')
-rw-r--r--nerv/examples/network_debug/network.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/nerv/examples/network_debug/network.lua b/nerv/examples/network_debug/network.lua
index 1841d21..386c3b0 100644
--- a/nerv/examples/network_debug/network.lua
+++ b/nerv/examples/network_debug/network.lua
@@ -72,12 +72,12 @@ function nn:process(data, do_train, reader)
for t = 1, self.gconf.chunk_size do
local tmp = info.output[t][1]:new_to_host()
for i = 1, self.gconf.batch_size do
- if t <= info.seq_length[i] then
- total_err = total_err + math.log10(math.exp(tmp[i - 1][0]))
- total_frame = total_frame + 1
- end
+ total_err = total_err + math.log10(math.exp(tmp[i - 1][0]))
end
end
+ for i = 1, self.gconf.batch_size do
+ total_frame = total_frame + info.seq_length[i]
+ end
timer:toc('IO')
timer:tic('network')