Exploring Different Initializers in Machine Learning
Initialization plays a critical role in training neural networks. Choosing the right initializer can significantly affect the speed of…
Exploring Different Initializers in Machine Learning

Initialization plays a critical role in training neural networks. Choosing the right initializer can significantly affect the speed of convergence and final performance of the model. In this blog, we’ll walk through various initialization methods, their purposes, and when to use them.
Introduction: Why Initialization Matters in Neural Networks
In neural networks, weights are assigned initial values before training begins. Effective initialization prevents issues like vanishing or exploding gradients, where the gradients become too small or too large, slowing down or even preventing training. Choosing an initializer helps control how weights are set at the beginning, making training smoother and more effective.
Step 1: Zero Initialization
Zero initialization sets all weights to zero.
- How it works: Each weight in the network is initialized to zero.
- Use case: Rarely used because it leads to symmetry problems. When all weights are identical, each neuron will learn the same features, limiting the network’s ability to learn complex patterns.
- Common in: Bias initialization rather than weights.
Step 2: Random Initialization
In random initialization, weights are set randomly using a small, fixed range.
- How it works: Weights are chosen randomly, often from a uniform or Gaussian distribution.
- Use case: Useful for small neural networks but can cause vanishing/exploding gradient issues in deep networks, making this less effective for deeper models.
- Common in: Early machine learning models.
Step 3: Xavier (Glorot) Initialization
Xavier Initialization (or Glorot Initialization) aims to balance the variances of the input and output layers, especially effective in networks using sigmoid or tanh activation functions.
- How it works: Weights are sampled from a distribution with zero mean and a variance calculated as:
Var(weight) = 2 / fan_in + fan_out2
- where fan_in is the number of input units, and fan_out is the number of output units.
- Use case: Good for sigmoid and tanh activation functions in shallow to moderately deep networks.
- Common in: Feedforward networks with sigmoid or tanh activations.
Step 4: He Initialization
He Initialization is designed to address the shortcomings of Xavier initialization for ReLU activation functions. It accounts for the fact that ReLU activations “die” for values less than zero.
- How it works: Weights are sampled from a distribution with zero mean and a variance of:
Var(weight) = 2 / fan_in
- Here, fan_in is the number of inputs to the layer.
- Use case: Ideal for ReLU and its variants (e.g., Leaky ReLU) in deep neural networks, where it avoids the vanishing gradient problem better than Xavier.
- Common in: Convolutional neural networks (CNNs) and deep networks with ReLU activations.
Step 5: Lecun Initialization
Lecun Initialization is tailored for the sigmoid and tanh functions but applies specifically when gradients can saturate.
- How it works: Weights are sampled from a distribution with a variance of:
Var(weight) = 1 / fan_in
- Use case: Works well with sigmoid and tanh activations, especially in shallow networks where gradients are likely to saturate.
- Common in: Shallow networks or networks with sigmoid activations.
Step 6: Orthogonal Initialization
Orthogonal Initialization sets initial weights to be orthogonal to each other, helping to preserve variance through the layers and improving gradient flow.
- How it works: Weights are initialized using matrices that are orthogonal. This is achieved by randomizing a matrix and then applying the Gram-Schmidt process.
- Use case: Suitable for RNNs and deep architectures with many layers where maintaining variance is crucial for stability.
- Common in: Recurrent neural networks (RNNs) and architectures where stable training is a concern.
Step 7: Variance Scaling Initialization
Variance scaling scales the weights based on the shape of each layer, adjusting the initialization for each layer independently.
- How it works: Weights are drawn from a distribution whose variance can be scaled by a factor.
- Use case: Useful for custom tuning in networks with various activation functions. TensorFlow’s
VarianceScalinginitializer allows this flexibility. - Common in: Custom or advanced deep learning models.
9. Comparison of Initializers and When to Use Them

10. Conclusion: Choosing the Right Initializer
Choosing the correct initializer is crucial for achieving faster convergence and avoiding training issues like vanishing or exploding gradients. By selecting the right initializer based on your network’s depth and activation functions, you improve the model’s stability and learning efficiency. For most modern architectures:
- He initialization is preferred for ReLU and its variants in deep networks.
- Xavier initialization works well for shallow networks with sigmoid or tanh activations.
- Orthogonal initialization stabilizes gradient flow in RNNs.
Understanding these initializers and their use cases equips you to make better choices for initializing your models, ultimately improving model performance and training time.
메타데이터
- post_id
- 2f7c9f507e89
- slug
- exploring-different-initializers-in-machine-learning-2f7c9f507e89
- url
- https://medium.com/@ppraveen2150/exploring-different-initializers-in-machine-learning-2f7c9f507e89
- canonical_url
- https://medium.com/@ppraveen2150/exploring-different-initializers-in-machine-learning-2f7c9f507e89
- author_url
- https://medium.com/@ppraveen2150
- status
- ok
- fetched_at
- 2026-07-13 06:23:13