diff options
author | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-04-15 11:26:05 +0300 |
---|---|---|
committer | Sergey Zagoruyko <zagoruyko2@gmail.com> | 2016-04-15 11:26:10 +0300 |
commit | a5c2b6fa7042fafa2d2179d5f7cccf06a026a15f (patch) | |
tree | 0ce864bbc09344eaaa6887740bc2d861dc5903a1 | |
parent | 5efc1569934b863c29365b75bedb8522c63576c4 (diff) |
add read for BatchNorm
-rw-r--r-- | BatchNormalization.lua | 10 |
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 = {} |