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

github.com/torch/nn.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.lua11
1 files changed, 11 insertions, 0 deletions
diff --git a/test/test.lua b/test/test.lua
index 135624d..1eb571e 100644
--- a/test/test.lua
+++ b/test/test.lua
@@ -1,5 +1,9 @@
require 'torch'
+-- you can easily test specific units like this:
+-- luajit -lnn -e "nn.test{'LookupTable'}"
+-- luajit -lnn -e "nn.test{'LookupTable', 'Add'}"
+
local mytester = torch.Tester()
local jac
local sjac
@@ -1821,6 +1825,13 @@ function nntest.LookupTable()
local ferr,berr = jac.testIO(module,input,minval,maxval)
mytester:asserteq(ferr, 0, torch.typename(module) .. ' - i/o forward err ')
mytester:asserteq(berr, 0, torch.typename(module) .. ' - i/o backward err ')
+
+ -- accUpdate
+ module:accUpdateOnly()
+ mytester:assert(not module.gradWeight, 'gradWeight is nil')
+ module:float()
+ local output = module:forward(input)
+ module:backwardUpdate(input, output, 0.1)
end
function nntest.AddConstant()