Git Product home page Git Product logo

batch_normalization's Introduction

Theoretical part

Batch normalization is a technique for improving the speed, performance, and stability of neural networks. 
batch normalization solves the problem of internal covariate shift (During the training stage of networks, as the parameters of the preceding layers change, the distribution of inputs to the current layer changes accordingly, such that the current layer needs to constantly readjust to new distributions)

Batch normalization has a slight regularization effect
But the main goal of batch normalization is normalize your hidden units activations and therefore speed up learning. The regularization is an almost unintended side effect.
Also batch normalization allows us to use much higher learning rates and be less careful about initialization. 
Batch normalization normalizes the output of a previous activation layer by subtracting the batch mean and dividing by the batch standard deviation.
However, after this shift/scale of activation outputs by some randomly initialized parameters, the weights in the next layer are no longer optimal. SGD ( Stochastic gradient descent) undoes this normalization if itÕs a way for it to minimize the loss function.
Consequently, batch normalization adds two trainable parameters (scale and shift) to each layer, so the normalized output is multiplied by a Òstandard deviationÓ parameter (scale) and add a ÒmeanÓ parameter (shift). In other words, batch normalization lets SGD do the denormalization by changing only these two weights for each activation, instead of losing the stability of the network by changing all the weights.

Practical part: 

I wrote custom layer for batch normalization and became convinced of its fullness.
I saw a very strong improving of neural network training speed.


To run my code use this command:
python3 train_and_evaluate.py



batch_normalization's People

Watchers

James Cloos avatar Anton Makarenko avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.