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

github.com/soumith/cudnn.torch.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Zagoruyko <zagoruyko2@gmail.com>2016-04-15 11:26:05 +0300
committerSergey Zagoruyko <zagoruyko2@gmail.com>2016-04-15 11:26:10 +0300
commita5c2b6fa7042fafa2d2179d5f7cccf06a026a15f (patch)
tree0ce864bbc09344eaaa6887740bc2d861dc5903a1
parent5efc1569934b863c29365b75bedb8522c63576c4 (diff)
add read for BatchNorm
-rw-r--r--BatchNormalization.lua10
1 files changed, 10 insertions, 0 deletions
diff --git a/BatchNormalization.lua b/BatchNormalization.lua
index b2520be..a342063 100644
--- a/BatchNormalization.lua
+++ b/BatchNormalization.lua
@@ -118,6 +118,16 @@ function BatchNormalization:clearDesc()
self.sDesc = nil
end
+function BatchNormalization:read(file, version)
+ parent.read(self, file)
+ if version < 2 then
+ if self.running_std then
+ self.running_var = self.running_std:pow(-2):add(-self.eps)
+ self.running_std = nil
+ end
+ end
+end
+
function BatchNormalization:write(f)
self:clearDesc()
local var = {}