Closed soyeollee closed 3 years ago
π Hello @SoYeol-Lee, thank you for your interest in YOLOv5 π! Please visit our βοΈ Tutorials to get started, where you can find quickstart guides for simple tasks like Custom Data Training all the way to advanced concepts like Hyperparameter Evolution.
If this is a π Bug Report, please provide screenshots and minimum viable code to reproduce your issue, otherwise we can not help you.
If this is a custom training β Question, please provide as much information as possible, including dataset images, training logs, screenshots, and a public link to online W&B logging if available.
For business inquiries or professional support requests please visit https://ultralytics.com or email Glenn Jocher at glenn.jocher@ultralytics.com.
Python>=3.6.0 with all requirements.txt installed including PyTorch>=1.7. To get started:
$ git clone https://github.com/ultralytics/yolov5
$ cd yolov5
$ pip install -r requirements.txt
YOLOv5 may be run in any of the following up-to-date verified environments (with all dependencies including CUDA/CUDNN, Python and PyTorch preinstalled):
If this badge is green, all YOLOv5 GitHub Actions Continuous Integration (CI) tests are currently passing. CI tests verify correct operation of YOLOv5 training (train.py), validation (val.py), inference (detect.py) and export (export.py) on MacOS, Windows, and Ubuntu every 24 hours and on every commit.
@SoYeol-Lee these is the YOLOv5 parameter groupings and decay schedules. Bias LR is initialized high to allow for fast improvements in bias during warmup.
is weight decay applied to beta and gamma in the batch normalization layer
@vishnubanna no
π Hello, this issue has been automatically marked as stale because it has not had recent activity. Please note it will be closed if no further activity occurs.
Access additional YOLOv5 π resources:
Access additional Ultralytics β‘ resources:
Feel free to inform us of any other issues you discover or feature requests that come to mind in the future. Pull Requests (PRs) are also always welcomed!
Thank you for your contributions to YOLOv5 π and Vision AI β!
@vishnubanna no
Hi @glenn-jocher understand it's based on settings from the paper. Going thru some older issues, I see you've done quite a lot of ablation studies with yolov5. Do you have any intuition of why this specific choice was made? Very curious
Edit: found this link that sorta tries to explain. https://stats.stackexchange.com/questions/576463/why-not-perform-weight-decay-on-layernorm-embedding. Do you see it the same way?
@ashwin-999, the decision not to apply weight decay to the parameters of batch normalization layers (specifically, the beta and gamma parameters) is indeed rooted in empirical findings and theoretical considerations. The primary intuition behind this choice is that these parameters are part of the normalization process, which aims to stabilize the distribution of activations throughout the network. Applying weight decay to these could potentially destabilize these distributions, leading to less effective training.
The link you found provides a good discussion on a related topic, focusing on why weight decay is not typically applied to normalization layers and embeddings. The reasoning aligns with our approach: normalization layers (like BatchNorm) and embeddings have a different role compared to typical weight matrices in a network. They are not directly involved in the "learning" of feature representations in the same way but are more about scaling and shifting those representations. Applying weight decay could hinder their ability to effectively scale and shift, which is why it's generally avoided.
In summary, the choice is based on both theoretical considerations and empirical evidence suggesting that excluding these parameters from weight decay leads to better training dynamics and model performance.
βQuestion
Additional context
Thank you for your contributions.
I have a question about weight decay.
In train.py,
there are different settings for parameters.
Only 'learning rate' is applied without 'weight_decay'.
What is a reason for this setting? Are there paper or ref for this issue?
Thank you.