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:
authorivpopov <ivpopov@google.com>2016-02-03 16:23:29 +0300
committerSergey Zagoruyko <zagoruyko2@gmail.com>2016-02-03 17:13:37 +0300
commit7e30f5f035aa1bb63498de345395818d5662cb7a (patch)
treeb194f457b827e07db8bf21be9d27810e063aaecb /test
parent66fec143a2afba199f752cb416c962bf5e949eb8 (diff)
Fixed issues with two tests
SpatialCrossEntropyCriterion - inconsistent averageSize normalization VolumetricMaxPooling_batch - will run out of memory: reducing maximal batch size
Diffstat (limited to 'test')
-rw-r--r--test/test.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/test/test.lua b/test/test.lua
index d6cdffd..493ce53 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -479,8 +479,8 @@ function cudnntest.VolumetricConvolution_backward_single()
end
function cudnntest.VolumetricMaxPooling_batch()
- local bs = math.random(1,32)
- local from = math.random(1,32)
+ local bs = math.random(1,4)
+ local from = math.random(1,4)
local ki = math.random(2,4)
local kj = math.random(2,4)
local kk = math.random(2,4)
@@ -1186,6 +1186,11 @@ function cudnntest.SpatialCrossEntropyCriterion()
ggi[{{}, {}, {i}, {j}}]:copy(ggi1)
end
end
+
+ -- nn.CrossEntropy in contrast to cudnn.SpatialCrossEntropyCriterion cannot
+ -- average over the last spatial dimensions because it is run in a loop
+ ggi:div(h * w)
+
local err = (gi - ggi):abs():max()
mytester:assertlt(err, precision_backward, 'error in difference between central difference and :backward')