alexgkendall / SegNet-Tutorial

Files for a tutorial to train SegNet for road scenes using the CamVid dataset
http://mi.eng.cam.ac.uk/projects/segnet/tutorial.html
847 stars 517 forks source link

added BN-absorber.py to merge bn layers into conv filters #97

Closed TimoSaemann closed 7 years ago

TimoSaemann commented 7 years ago

For inference the batch normalization layers can be merged into convolutional kernels, to speed up the network. Both layers applies a linear transformation. For that reason the batch normalization layers can be absorbed in the previous convolutional layer by modifying its weights and biases. That is exactly what the script does. In doing so it is possible to speed up SegNet by around 30 %.

alexgkendall commented 7 years ago

Awesome, thanks!