szagoruyko / imagine-nn

IMAGINE torch neural network routines
Other
109 stars 35 forks source link

Script for folding BatchNorm into conv and linear layers #30

Closed szagoruyko closed 8 years ago

szagoruyko commented 8 years ago

works only for the case when batchnorm is after conv or linear usage is supposed to be like that:

local utils = require 'inn.utils'
print('folding BN error:', utils.testSurgery(input, utils.foldBatchNorm, net)) -- check that we did not break anything
mys007 commented 8 years ago

Nice! I guess you can extend it to the Volumetric version too...

szagoruyko commented 8 years ago

@mys007 yes should not be difficult to extend, just change the strings.

fmassa commented 8 years ago

Both functions could be condensated into only one template function, right ?

szagoruyko commented 8 years ago

@fmassa right, could be done.