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:
authorClement Farabet <clement.farabet@gmail.com>2011-09-02 06:53:47 +0400
committerClement Farabet <clement.farabet@gmail.com>2011-09-02 06:53:47 +0400
commitab854c6f2490c33802fb074b1ace517a407848ee (patch)
treee6961349d67531e7844601075117acf2197eb233
parent9bc8cc01e1bbbc5d532a22d58061964c036f43e5 (diff)
Fixed tester.
-rw-r--r--test/test-all.lua87
1 files changed, 0 insertions, 87 deletions
diff --git a/test/test-all.lua b/test/test-all.lua
index 148e860..f7e591a 100644
--- a/test/test-all.lua
+++ b/test/test-all.lua
@@ -301,93 +301,6 @@ function nnxtest.SpatialConvolution()
mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
end
-function nnxtest.SpatialConvolutionSparse_1()
- local from = math.random(1,10)
- local to = math.random(1,10)
- local ini = math.random(10,20)
- local inj = math.random(10,20)
- local ki = math.random(1,10)
- local kj = math.random(1,10)
- local si = math.random(1,1)
- local sj = math.random(1,1)
-
- local ct = nn.tables.full(from,to)
- local module = nn.SpatialConvolutionSparse(ct, ki, kj, si, sj)
- local input = torch.Tensor(from, inj, ini):zero()
- module:reset()
-
- local err = nn.Jacobian.testJacobian(module, input)
- mytester:assertlt(err, precision, 'error on state ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.weight, module.gradWeight)
- mytester:assertlt(err, precision, 'error on weight ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.bias, module.gradBias)
- mytester:assertlt(err, precision, 'error on bias ')
-
- local ferr, berr = nn.Jacobian.testIO(module, input)
- mytester:asserteq(ferr, 0, torch.typename(module) .. ' - i/o forward err ')
- mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
-end
-
-function nnxtest.SpatialConvolutionSparse_2()
- local from = math.random(1,10)
- local to = math.random(1,10)
- local ini = math.random(10,20)
- local inj = math.random(10,20)
- local ki = math.random(1,10)
- local kj = math.random(1,10)
- local si = math.random(1,1)
- local sj = math.random(1,1)
-
- local ct = nn.tables.oneToOne(from)
- local module = nn.SpatialConvolutionSparse(ct, ki, kj, si, sj)
- local input = torch.Tensor(from, inj, ini):zero()
- module:reset()
-
- local err = nn.Jacobian.testJacobian(module, input)
- mytester:assertlt(err, precision, 'error on state ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.weight, module.gradWeight)
- mytester:assertlt(err, precision, 'error on weight ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.bias, module.gradBias)
- mytester:assertlt(err, precision, 'error on bias ')
-
- local ferr, berr = nn.Jacobian.testIO(module, input)
- mytester:asserteq(ferr, 0, torch.typename(module) .. ' - i/o forward err ')
- mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
-end
-
-function nnxtest.SpatialConvolutionSparse_3()
- local from = math.random(2,6)
- local to = math.random(4,8)
- local ini = math.random(10,20)
- local inj = math.random(10,20)
- local ki = math.random(1,10)
- local kj = math.random(1,10)
- local si = math.random(1,1)
- local sj = math.random(1,1)
-
- local ct = nn.tables.random(from,to,from-1)
- local module = nn.SpatialConvolutionSparse(ct, ki, kj, si, sj)
- local input = torch.Tensor(from, inj, ini):zero()
- module:reset()
-
- local err = nn.Jacobian.testJacobian(module, input)
- mytester:assertlt(err, precision, 'error on state ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.weight, module.gradWeight)
- mytester:assertlt(err, precision, 'error on weight ')
-
- local err = nn.Jacobian.testJacobianParameters(module, input, module.bias, module.gradBias)
- mytester:assertlt(err, precision, 'error on bias ')
-
- local ferr, berr = nn.Jacobian.testIO(module, input)
- mytester:asserteq(ferr, 0, torch.typename(module) .. ' - i/o forward err ')
- mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
-end
-
function nnxtest.SpatialNormalization_Gaussian2D()
local inputSize = math.random(11,20)
local kersize = 9