GithubHelp home page GithubHelp logo

victorcampos7 / weightnorm-init Goto Github PK

View Code? Open in Web Editor NEW
14.0 2.0 1.0 1.1 MB

Code for "How to Initialize your Network? Robust Initialization for WeightNorm & ResNets"

License: MIT License

Python 8.11% Jupyter Notebook 91.89%

weightnorm-init's Introduction

How to Initialize your Network? Robust Initialization for WeightNorm & ResNets

This repository contains code for How to Initialize your Network? Robust Initialization for WeightNorm & ResNets.

Abstract

Residual networks (ResNet) and weight normalization play an important role in various deep learning applications. However, parameter initialization strategies have not been studied previously for weight normalized networks and, in practice, initialization methods designed for un-normalized networks are used as a proxy. Similarly, initialization for ResNets have also been studied for un-normalized networks and often under simplified settings ignoring the shortcut connection. To address these issues, we propose a novel parameter initialization strategy that avoids explosion/vanishment of information across layers for weight normalized networks with and without residual connections. The proposed strategy is based on a theoretical analysis using mean field approximation. We run over 2,500 experiments and evaluate our proposal on image datasets showing that the proposed initialization outperforms existing initialization methods in terms of generalization performance, robustness to hyper-parameter values and variance between seeds, especially when networks get deeper in which case existing methods fail to even start training. Finally, we show that using our initialization in conjunction with learning rate warmup is able to reduce the gap between the performance of weight normalized and batch normalized networks.

Dependencies

This project was developed with Python 3.6. Dependencies can be installed using the provided requirements.txt file.

Running the code

Figure 1 in the paper can be reproduced with src/notebooks/synthetic_data_experiment.ipynb. The rest of experiments can be reproduced with src/train.py.

For instance, the following command would train an MLP on MNIST using WeightNorm with the proposed initialization:

cd src && python -m train --dataset mnist --nn mlp --weight_norm --init orthogonal_proposed

Citation

If you use this in your work, please cite

@article{arpit2019initialize,
  title={How to Initialize your Network? Robust Initialization for WeightNorm \& ResNets},
  author={Arpit, Devansh and Campos, Victor and Bengio, Yoshua},
  journal={arXiv preprint arXiv:1906.02341},
  year={2019}
}

weightnorm-init's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

pingfanw

weightnorm-init's Issues

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.