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
diff options
context:
space:
mode:
authorSergey Zagoruyko <sergey.zagoruyko@imagine.enpc.fr>2015-02-05 16:48:42 +0300
committerSergey Zagoruyko <sergey.zagoruyko@imagine.enpc.fr>2015-02-05 16:48:42 +0300
commit227fedec91f6d7f38e8bb62fcfd32c2316af634f (patch)
tree3c9d148f03510f38d1eb5462350ba819ce961493 /test.lua
parent5137714bae52c59bc663c0a57dd730712130457d (diff)
multimargin supports p=2
Diffstat (limited to 'test.lua')
-rw-r--r--test.lua7
1 files changed, 7 insertions, 0 deletions
diff --git a/test.lua b/test.lua
index f555b50..a8f81f5 100644
--- a/test.lua
+++ b/test.lua
@@ -693,6 +693,13 @@ function nntest.MarginCriterion()
criterionJacobianTest1D(cri, input, target)
end
+function nntest.MultiMarginCriterion()
+ local input = torch.rand(100)
+ local target = math.random(1,100)
+ local cri = nn.MultiMarginCriterion(math.random(1,2))
+ criterionJacobianTest1D(cri, input, target)
+end
+
function nntest.WeightedMSECriterion()
local input = torch.rand(10)
local target = input:clone():add(torch.rand(10))