Skip to content

Commit

Permalink
Fix compatibility issues with the latest Torch7 version; Please re-do…
Browse files Browse the repository at this point in the history
…wnload the updated model
  • Loading branch information
bgshih committed Feb 22, 2016
1 parent 296c5f4 commit 9b63d1b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utilities.lua
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ end

function modelState(model)
--[[ Get model state, including model parameters (weights and biases) and
running mean/std in batch normalization layers
running mean/var in batch normalization layers
ARGS:
- `model` : network model
RETURN:
Expand All @@ -235,12 +235,12 @@ function modelState(model)
local bnLayers = model:findModules('nn.BatchNormalization')
for i = 1, #bnLayers do
bnVars[#bnVars+1] = bnLayers[i].running_mean
bnVars[#bnVars+1] = bnLayers[i].running_std
bnVars[#bnVars+1] = bnLayers[i].running_var
end
local bnLayers = model:findModules('nn.SpatialBatchNormalization')
for i = 1, #bnLayers do
bnVars[#bnVars+1] = bnLayers[i].running_mean
bnVars[#bnVars+1] = bnLayers[i].running_std
bnVars[#bnVars+1] = bnLayers[i].running_var
end
local state = {parameters = parameters, bnVars = bnVars}
return state
Expand Down

0 comments on commit 9b63d1b

Please sign in to comment.