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

CriterionTable.lua - github.com/torch/nn.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 14c64aca7d0a7346520adbc4af1ee065ac1b680e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
local CriterionTable, parent = torch.class('nn.CriterionTable', 'nn.Module')

function CriterionTable:__init(criterion)
   parent.__init(self)
   self.criterion = criterion
   self.gradInput = {criterion.gradInput}
end

function CriterionTable:updateOutput(input) 
   self.output = self.criterion:updateOutput(table.unpack(input))
   return self.output
end
    
function CriterionTable:updateGradInput(input, gradOutput)
  self.criterion:updateGradInput(table.unpack(input))
  return self.gradInput
end