diff options
author | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2015-09-14 01:55:58 +0300 |
---|---|---|
committer | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2015-09-14 01:55:58 +0300 |
commit | bd3808481909cba0dab0a473857fbd8111a916f1 (patch) | |
tree | 00cfc5f4640a2a958b621405ce897db5649cc2cb /SmoothL1Criterion.lua | |
parent | 33196ac2e417cf722c959727a959759d6576324a (diff) |
Add SmoothL1 criterion
Diffstat (limited to 'SmoothL1Criterion.lua')
-rw-r--r-- | SmoothL1Criterion.lua | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/SmoothL1Criterion.lua b/SmoothL1Criterion.lua new file mode 100644 index 0000000..4baf171 --- /dev/null +++ b/SmoothL1Criterion.lua @@ -0,0 +1,14 @@ +local SmoothL1Criterion, parent = torch.class('nn.SmoothL1Criterion', 'nn.Criterion') + +function SmoothL1Criterion:__init() + parent.__init(self) + self.sizeAverage = true +end + +function SmoothL1Criterion:updateOutput(input, target) + return input.nn.SmoothL1Criterion_updateOutput(self, input, target) +end + +function SmoothL1Criterion:updateGradInput(input, target) + return input.nn.SmoothL1Criterion_updateGradInput(self, input, target) +end |