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 /Toc.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 'Toc.lua')
-rw-r--r--Toc.lua19
1 files changed, 19 insertions, 0 deletions
diff --git a/Toc.lua b/Toc.lua
new file mode 100644
index 0000000..059211e
--- /dev/null
+++ b/Toc.lua
@@ -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