Jump to content

Weight initialization

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by Cosmia Nebula (talk | contribs) at 23:30, 5 October 2024 (init). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

In machine learning and deep learning, weight initialization describes the initial step in creating a neural network. A neural network contains trainable parameters that are modified during training. Before training, these need to be assigned initial values. This assignment step is weight initialization.

The choice of weight initialization method affects the speed of convergence, the scale of neural activation within the network, the scale of gradient signals during backpropagation, and the quality of the final model. Proper initialization is necessary for avoiding issues such as vanishing and exploding gradients, saturation of activation function, etc.

Initialization schemes

We discuss the main methods of initialization in the context of a multilayer perceptron (MLP). Specific strategies for initializing other network architectures are discussed in later sections.

For an MLP, there are only two kinds of trainable parameters, called weights and biases. Each layer contains a weight matrix and a bias vector , where is the number of neurons in that layer. A weight initialization method is an algorithm for setting the initial values for for each layer .

Zero initialization

The simplest form is zero initialization:Zero initialization is sometimes used for initializing biases, but it is not used for initializing weights, as it leads to symmetry in the network, causing all neurons to learn the same features.

Random initialization

Random initialization involves setting the weights to small random values, typically drawn from a normal distribution or a uniform distribution.

The uniform random initialization is typically by sampling each entry in from the uniform distribution .

Glorot initialization

Glorot initialization (or Xavier initialization) was proposed by Xavier Glorot and Yoshua Bengio.[1] It was designed to keep the scale of gradients roughly the same in all layers.

For uniform initialization, it samples each entry in from . In the context, is also called the "fan-in", and the "fan-out".

He initialization

He initialization (or Kaiming initialization) was proposed by Kaiming He et al.[2] It was designed for networks with ReLU activation.

It samples each entry in from .

Other methods

For hyperbolic tangent activation function, a particular scaling is sometimes used: . This was sometimes called "LeCun's tanh". It was designed so that if the input has variance roughly 1, then the output has variance roughly 1.[3][4]

[5][6]

See also

References

  1. ^ Glorot, Xavier; Bengio, Yoshua (2010-03-31). "Understanding the difficulty of training deep feedforward neural networks". Proceedings of the Thirteenth International Conference on Artificial Intelligence and Statistics. JMLR Workshop and Conference Proceedings: 249–256.
  2. ^ He, Kaiming; Zhang, Xiangyu; Ren, Shaoqing; Sun, Jian (2015). "Delving Deep into Rectifiers: Surpassing Human-Level Performance on ImageNet Classification". doi:10.48550/ARXIV.1502.01852. {{cite journal}}: Cite journal requires |journal= (help)
  3. ^ Y. LeCun. Generalization and network design strategies. In R. Pfeifer, Z. Schreter, F. Fogelman, and L. Steels, editors, Connectionism in Perspective, Amsterdam, 1989. Elsevier. Proceedings of the International Conference Connectionism in Perspective, University of Zurich, 10. -- 13. October 1988.
  4. ^ LeCun, Yann; Bottou, Leon; Orr, Genevieve B.; Müller, Klaus -Robert (1998), Orr, Genevieve B.; Müller, Klaus-Robert (eds.), "Efficient BackProp", Neural Networks: Tricks of the Trade, Berlin, Heidelberg: Springer, pp. 9–50, doi:10.1007/3-540-49430-8_2, ISBN 978-3-540-49430-0, retrieved 2024-10-05
  5. ^ Hanin, Boris; Rolnick, David (2018). "How to Start Training: The Effect of Initialization and Architecture". Advances in Neural Information Processing Systems. 31. Curran Associates, Inc.
  6. ^ Mishkin, Dmytro; Matas, Jiri (2016-02-19), All you need is a good init, doi:10.48550/arXiv.1511.06422, retrieved 2024-10-05

Further reading

  • Narkhede, Meenal V.; Bartakke, Prashant P.; Sutaone, Mukul S. (June 28, 2021). "A review on weight initialization strategies for neural networks". Artificial Intelligence Review. 55 (1). Springer Science and Business Media LLC: 291–322. doi:10.1007/s10462-021-10033-z. ISSN 0269-2821.