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:
authorSeanNaren <taz838@hotmail.co.uk>2016-06-11 14:43:04 +0300
committerSeanNaren <taz838@hotmail.co.uk>2016-06-11 14:43:04 +0300
commitae1c144739c18b50169717d8517b3b180dbc3c93 (patch)
treec63c6b8c583c7411e529ee82df154a14a1be9e07 /test
parentdbb1a44bbe46e394fee423647101db72a0310f14 (diff)
Added clipped ReLU
Diffstat (limited to 'test')
-rw-r--r--test/test.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index a448317..aac45b4 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -962,6 +962,16 @@ function cudnntest.ReLU_batch()
nonlinBatch('ReLU')
end
+function cudnntest.ClippedReLU_single()
+ local input = torch.randn(1, 32):cuda()
+ local ceiling = 0.1
+ local module = cudnn.ClippedReLU(true, ceiling):cuda()
+ local output = module:forward(input)
+ local expectedOutput = input:clone()
+ expectedOutput[expectedOutput:ge(ceiling)] = ceiling
+ mytester:assertTensorEq(output, expectedOutput)
+end
+
function cudnntest.Tanh_single()
nonlinSingle('Tanh')
end