diff options
author | Michael 'myrhev' Mathieu <michael.mathieu@ens.fr> | 2012-04-27 00:32:15 +0400 |
---|---|---|
committer | Michael 'myrhev' Mathieu <michael.mathieu@ens.fr> | 2012-04-27 00:50:18 +0400 |
commit | 300bd31b0ec5bc108ce78b4f3730f8c67fc5a8bc (patch) | |
tree | 1e740a1d333966c20315ced3ccf25bca1d1cbacb /Toc.lua | |
parent | c551b07dabd2beebdfe7e534e2a8dd247077c61d (diff) |
Add SpatialReSamplingEx (grouping all the Spatial*Sampling).
SpatialPadding can now pad on dimensions different than (2,3).
Add Tic/Toc modules, to time a network
Diffstat (limited to 'Toc.lua')
-rw-r--r-- | Toc.lua | 19 |
1 files changed, 19 insertions, 0 deletions
@@ -0,0 +1,19 @@ +require 'nn' +local Toc, parent = torch.class('nn.Toc', 'nn.Module') + +function Toc:__init(name, comment) + parent.__init(self) + self.name = name or 'default' + self.comment = comment or '' +end + +function Toc:updateOutput(input) + print("Toc '"..self.name.."' ("..self.comment..") : "..tic_modules[self.name]:time()['real']) + self.output = input + return self.output +end + +function Toc:updateGradInput(input, gradOutput) + self.gradInput = gradOutput + return self.gradInput +end |