All Projects → MIPT-Oulu → Pytorch_bn_fusion

MIPT-Oulu / Pytorch_bn_fusion

Licence: mit
Batch normalization fusion for PyTorch

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pytorch bn fusion

Tutorial separation
This repo summarizes the tutorials, datasets, papers, codes and tools for speech separation and speaker extraction task. You are kindly invited to pull requests.
Stars: ✭ 151 (-7.93%)
Mutual labels:  deep-neural-networks
Zi2zi
Learning Chinese Character style with conditional GAN
Stars: ✭ 1,988 (+1112.2%)
Mutual labels:  deep-neural-networks
Guesslang
Detect the programming language of a source code
Stars: ✭ 159 (-3.05%)
Mutual labels:  deep-neural-networks
Webdnn
The Fastest DNN Running Framework on Web Browser
Stars: ✭ 1,850 (+1028.05%)
Mutual labels:  deep-neural-networks
Aw nas
aw_nas: A Modularized and Extensible NAS Framework
Stars: ✭ 152 (-7.32%)
Mutual labels:  deep-neural-networks
Best ai paper 2020
A curated list of the latest breakthroughs in AI by release date with a clear video explanation, link to a more in-depth article, and code
Stars: ✭ 2,140 (+1204.88%)
Mutual labels:  deep-neural-networks
Models Comparison.pytorch
Code for the paper Benchmark Analysis of Representative Deep Neural Network Architectures
Stars: ✭ 148 (-9.76%)
Mutual labels:  deep-neural-networks
Deep Learning With Tensorflow
Deep Learning with TensorFlow by Packt
Stars: ✭ 163 (-0.61%)
Mutual labels:  deep-neural-networks
Squeezesegv2
Implementation of SqueezeSegV2, Improved Model Structure and Unsupervised Domain Adaptation for Road-Object Segmentation from a LiDAR Point Cloud
Stars: ✭ 154 (-6.1%)
Mutual labels:  deep-neural-networks
Applied Deep Learning With Tensorflow
Learn applied deep learning from zero to deployment using TensorFlow 1.8+
Stars: ✭ 160 (-2.44%)
Mutual labels:  deep-neural-networks
Mariana
The Cutest Deep Learning Framework which is also a wonderful Declarative Language
Stars: ✭ 151 (-7.93%)
Mutual labels:  deep-neural-networks
Msg Net
Multi-style Generative Network for Real-time Transfer
Stars: ✭ 152 (-7.32%)
Mutual labels:  deep-neural-networks
Sign Language Interpreter Using Deep Learning
A sign language interpreter using live video feed from the camera.
Stars: ✭ 157 (-4.27%)
Mutual labels:  deep-neural-networks
Awesome Deep Neuroevolution
A collection of Deep Neuroevolution resources or evolutionary algorithms applying in Deep Learning (constantly updating)
Stars: ✭ 150 (-8.54%)
Mutual labels:  deep-neural-networks
Hey Jetson
Deep Learning based Automatic Speech Recognition with attention for the Nvidia Jetson.
Stars: ✭ 161 (-1.83%)
Mutual labels:  deep-neural-networks
Densenet Sdr
repo that holds code for improving on dropout using Stochastic Delta Rule
Stars: ✭ 148 (-9.76%)
Mutual labels:  deep-neural-networks
Self Driving Car
Udacity Self-Driving Car Engineer Nanodegree projects.
Stars: ✭ 2,103 (+1182.32%)
Mutual labels:  deep-neural-networks
Iresnet
Improved Residual Networks (https://arxiv.org/pdf/2004.04989.pdf)
Stars: ✭ 163 (-0.61%)
Mutual labels:  deep-neural-networks
Tf Adnet Tracking
Deep Object Tracking Implementation in Tensorflow for 'Action-Decision Networks for Visual Tracking with Deep Reinforcement Learning(CVPR 2017)'
Stars: ✭ 162 (-1.22%)
Mutual labels:  deep-neural-networks
Dynamics
A Compositional Object-Based Approach to Learning Physical Dynamics
Stars: ✭ 159 (-3.05%)
Mutual labels:  deep-neural-networks

Batch Norm Fusion for Pytorch

About

In this repository, we present a simplistic implementation of batchnorm fusion for the most popular CNN architectures in PyTorch. This package is aimed to speed up the inference at the test time: expected boost is 30%! In the future

How it works

We know that both - convolution and batchnorm are the linear operations to the data point x, and they can be written in terms of matrix multiplications: T_{bn}*S{bn}Conv_W(x), where we first apply convolution to the data, scale it and eventually shift it using the batchnorm-trained parameters.

Supported architectures

We support any architecture, where Conv and BN are combined in a Sequential module. If you want to optimize your own networks with this tool, just follow this design. For the conveniece, we wrapped VGG, ResNet and SeNet families to demonstrate how your models can be converted into such format.

  • [x] VGG from torchvision.
  • [x] ResNet Family from torchvision.
  • [x] SeNet family from pretrainedmodels

How to use

import torchvision.models as models
from bn_fusion import fuse_bn_recursively

net = getattr(models,'vgg16_bn')(pretrained=True)
net = fuse_bn_recursively(net)
net.eval()
# Make inference with the converted model

TODO

  • [ ] Tests.
  • [ ] Performance benchmarks.

Acknowledgements

Thanks to @ZFTurbo for the idea, discussions and his implementation for Keras.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].