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

github.com/clementfarabet/lua---nnx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael 'myrhev' Mathieu <michael.mathieu@ens.fr>2012-04-27 00:32:15 +0400
committerMichael 'myrhev' Mathieu <michael.mathieu@ens.fr>2012-04-27 00:50:18 +0400
commit300bd31b0ec5bc108ce78b4f3730f8c67fc5a8bc (patch)
tree1e740a1d333966c20315ced3ccf25bca1d1cbacb /Tic.lua
parentc551b07dabd2beebdfe7e534e2a8dd247077c61d (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 'Tic.lua')
-rw-r--r--Tic.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/Tic.lua b/Tic.lua
new file mode 100644
index 0000000..db50e55
--- /dev/null
+++ b/Tic.lua
@@ -0,0 +1,20 @@
+require 'nn'
+local Tic, parent = torch.class('nn.Tic', 'nn.Module')
+
+function Tic:__init(name)
+ parent.__init(self)
+ self.name = name or 'default'
+ tic_modules = tic_modules or {}
+ tic_modules[self.name] = torch.Timer()
+end
+
+function Tic:updateOutput(input)
+ tic_modules[self.name]:reset()
+ self.output = input
+ return self.output
+end
+
+function Tic:updateGradInput(input, gradOutput)
+ self.gradInput = gradOutput
+ return self.gradInput
+end