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

Minus.lua - github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: d268146a17b282ad13bb60d5c51d602f59aee386 (plain)
1
2
3
4
5
6
7
8
9
10
11
local Minus, parent = torch.class('nn.Minus', 'nn.Module')

function Minus:updateOutput(input)
   self.output:resizeAs(input):copy(input):mul(-1)
   return self.output
end

function Minus:updateGradInput(input, gradOutput)
   self.gradInput:resizeAs(input):copy(gradOutput):mul(-1)
   return self.gradInput
end