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

github.com/soumith/cudnn.torch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/test.lua38
-rw-r--r--test/test_groups.lua2
2 files changed, 14 insertions, 26 deletions
diff --git a/test/test.lua b/test/test.lua
index aa8ea7f..a4f9bcb 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -25,7 +25,7 @@ local testparams_float = {
}
-- TODO: find out why the errors are so huge
-local testparams_double_err = {
+local testparams_double = {
test_type = 'torch.CudaDoubleTensor',
precision_forward = 1e+2,
precision_backward = 1e+3, -- 1e+4,
@@ -33,14 +33,6 @@ local testparams_double_err = {
precision_io = 1e-5,
}
-local testparams_double = {
- test_type = 'torch.CudaDoubleTensor',
- precision_forward = 1e-4,
- precision_backward = 2e-2,
- precision_jac = 1e-3,
- precision_io = 1e-5,
-}
-
local testparams = testparams_half
local function cast(input)
@@ -185,11 +177,8 @@ function cudnntest.SpatialConvolution_forward_single()
cutorch.synchronize()
mytester:asserteq(rescuda:dim(), 3, 'error in dimension')
local error = rescuda:float() - groundtruth:float()
- if cudnn.verbose and error:abs():max() > tonumber(testparams.precision_forward) then
- print('\n==== rescuda:float():\n', rescuda:float(), '\n==== groundtruth:float():\n', groundtruth:float())
- end
mytester:assertlt(error:abs():max(), testparams.precision_forward,
- 'error on state (forward)')
+ 'error on state (forward) ')
-- IO
local ferr,berr = jac.testIO(gconv, cast(input))
@@ -1054,7 +1043,7 @@ function cudnntest.SpatialCrossMapLRN_batch()
local size = math.random(1,3)*2+1
local nbfeatures = math.random(3,8)
local alpha = math.random(1,100)/100
- local beta = math.random(1,100)/100
+ local beta = math.random(0,100)/100
local k = math.random(1,3)
local tm = {}
@@ -1519,8 +1508,8 @@ mytester = torch.Tester()
mytester:add(cudnntest)
if torch.random(1,2) == 1 then
- cudnn.benchmark = true -- run manual auto-tuner
- cudnn.verbose = true
+ cudnn.benchmark = true -- run manual auto-tuner
+-- cudnn.verbose = true
end
@@ -1530,21 +1519,20 @@ for i=1,cutorch.getDeviceCount() do
print('Running test on device: #' .. i .. ' : ' .. prop.name)
cutorch.setDevice(i)
--- double tensor may be broken
--- print'Testing torch.CudaDoubleTensor'
--- torch.setdefaulttensortype('torch.DoubleTensor')
--- testparams = testparams_double
--- mytester:run()
+
+ print'Testing torch.CudaHalfTensor'
+ testparams = testparams_half
+ mytester:run()
print'Testing torch.CudaTensor'
testparams = testparams_float
mytester:run()
+-- double tensor may be broken at some places, gets NaNs.
+-- print'Testing torch.CudaDoubleTensor'
+-- testparams = testparams_double
+-- mytester:run()
--- half tensor is broken on Pascal
- print'Testing torch.CudaHalfTensor: note there may be errors on 6.x (Pascal) cards'
- testparams = testparams_half
- mytester:run()
end
os.execute('rm -f modelTemp.t7')
diff --git a/test/test_groups.lua b/test/test_groups.lua
index 1675fdd..8b386b9 100644
--- a/test/test_groups.lua
+++ b/test/test_groups.lua
@@ -34,6 +34,6 @@ ccn2_gradWeight = ccn2_conv.gradWeight:t()
assert((cudnn_output - ccn2_output):abs():max() < 1e-4)
assert((cudnn_gradInput - ccn2_gradInput):abs():max() < 1e-4)
-assert((cudnn_gradWeight - ccn2_gradWeight):abs():max() < 1e-1)
+assert((cudnn_gradWeight - ccn2_gradWeight):abs():max() < 5e-2)
print 'no assertions'