diff options
author | Andreas Fidjeland <andreas.fidjeland@gmail.com> | 2012-09-13 19:49:02 +0400 |
---|---|---|
committer | Andreas Fidjeland <andreas.fidjeland@gmail.com> | 2012-09-13 19:49:35 +0400 |
commit | 49c57008c04228a6598f867a5a88c5ffc99e61be (patch) | |
tree | b9f46e92c82eac71a8afa95ffe4ec98f379fb8c2 | |
parent | 66421de171a303366dd6e87bc9b6acfd99d03dcd (diff) |
Fixed hessian parameter flattening
This previously failed for nn modules which do not return any hessian parameters.
-rw-r--r-- | hessian.lua | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/hessian.lua b/hessian.lua index 4ecc90a..af604d5 100644 --- a/hessian.lua +++ b/hessian.lua @@ -336,7 +336,7 @@ function nn.hessian.enable() local flatParameters = flatten(parameters) local flatGradParameters = flatten(gradParameters) local flatHessianParameters - if hessianParameters[1] then + if hessianParameters and hessianParameters[1] then flatHessianParameters = flatten(hessianParameters) end |