Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Saxton <saxton@google.com>2016-02-18 18:38:10 +0300
committerDavid Saxton <saxton@google.com>2016-02-18 18:38:10 +0300
commitd858d9322fbf303e351f381cf75f9920f6446864 (patch)
tree94a1c4fb08daee430843906f3aebff22f4ef1daa
parent08706fa21c6df745756538d1cd47dd8c1a8c20b1 (diff)
Fix the use of the tester.
(Should either not pass a "tolerance" parameter to asserteq, or should be using assertalmosteq - I've opted for the latter to keep it consistent with the use of assertTensorEq.)
-rw-r--r--test/test-all.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/test/test-all.lua b/test/test-all.lua
index df7b7bb..760d452 100644
--- a/test/test-all.lua
+++ b/test/test-all.lua
@@ -447,8 +447,8 @@ function nnxtest.SoftMaxTree()
local param, grad = smt:getNodeParameters(parentId)
local weight, bias = unpack(param)
local gradWeight, gradBias = unpack(grad)
- mytester:asserteq(gradWeight:sum(), 0, 0.000001)
- mytester:asserteq(gradBias:sum(), 0, 0.000001)
+ mytester:assertalmosteq(gradWeight:sum(), 0, 0.000001)
+ mytester:assertalmosteq(gradBias:sum(), 0, 0.000001)
linear.weight:set(weight:clone())
linear.bias:set(bias:clone())
s:add(linear)
@@ -471,7 +471,7 @@ function nnxtest.SoftMaxTree()
mytester:assert(math.abs(output[3] - mlp_act[1]) < 0.00001)
mytester:assertTensorEq(gradInput[3], mlp_grad, 0.00001)
-- update
- mytester:asserteq(smt.updates[29], 5, 0.000001)
+ mytester:assertalmosteq(smt.updates[29], 5, 0.000001)
smt:updateParameters(0.1)
mlp:updateParameters(0.1)
local parentId = 8