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:
authorClement Farabet <clement.farabet@gmail.com>2011-08-03 05:50:09 +0400
committerClement Farabet <clement.farabet@gmail.com>2011-08-03 05:50:09 +0400
commitd1924964e4743e4da165b7eb2b12edd6d26f8e37 (patch)
treee74fb9f26959185dacfaed9ec4b8923e5b3b2bbb
parent86b6cb4fc2c29e1232a1c70a38ae82d23260f615 (diff)
Smarter hash for SpatialFovea ?
-rw-r--r--SpatialFovea.lua6
1 files changed, 4 insertions, 2 deletions
diff --git a/SpatialFovea.lua b/SpatialFovea.lua
index 26dbf55..deaba65 100644
--- a/SpatialFovea.lua
+++ b/SpatialFovea.lua
@@ -137,8 +137,10 @@ function SpatialFovea:forward(input)
-- create or reuse list of cached inputs
self.cachedPreProcessed = self.cachedPreProcessed or {}
- -- the norm of the input should be enough to serve as a solid hash
- hash = tostring(input:sum())
+ -- compute an abritrary hash, should be strong enough
+ tohash = input:narrow(2,1,math.min(input:size(2),32)):narrow(3,1,math.min(input:size(3),32))
+ hash = tostring(tohash:sum())
+ hash = hash .. tostring(tohash:std())
-- check if input was seend before
if self.cachedPreProcessed[hash] then