e-lab / torch-toolbox

A collection of snippets and libraries for Torch from e-Lab
https://engineering.purdue.edu/elab/
199 stars 64 forks source link

Error invstd not found #9

Closed arunpatala closed 8 years ago

arunpatala commented 8 years ago

I think with the change from running_std to running_var the BN absorber is not working. I tried calculating running_var from running_std. But the output doesnt match after using BN absorber.

./BN-absorber.lua:5: attempt to index local 'invstd' (a nil value)
stack traceback:
./BN-absorber.lua:5: in function 'absorb_bn_conv'
./BN-absorber.lua:73: in function <./BN-absorber.lua:26>
example.lua:33: in main chunk
[C]: in function 'dofile'
...arun/torch/install/lib/luarocks/rocks/trepl/scm-1/bin/th:145: in main chunk
[C]: at 0x00405ea0

jhjin commented 8 years ago

This should be fixed by https://github.com/e-lab/torch-toolbox/commit/3fcd60fc2be0381d958f7a7909658d6f5404af4d Your try was right but the reason for the mismatch was about where to add/subtract the epsilon. The small error causes quite big numerical difference during a feedforward.