Created
February 7, 2016 22:47
-
-
Save szagoruyko/2831b1ab990bb24ade14 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ts = { | |
model = net, | |
unpack = function(self) | |
for k,v in ipairs(self.model:listModules()) do | |
if v.weight and not v.gradWeight then | |
v.gradWeight = v.weight:clone() | |
v.gradBias = v.bias:clone() | |
end | |
end | |
return self.model | |
end | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment