PaddlePaddle / PaddleDetection

Object Detection toolkit based on PaddlePaddle. It supports object detection, instance segmentation, multiple object tracking and real-time multi-person keypoint detection.
Apache License 2.0
12.38k stars 2.84k forks source link

[Other General Issues] 请问一下,PP-YOLOE-s的weight_decay参数是在哪里设置的呢? #5944

Closed songyuc closed 2 years ago

songyuc commented 2 years ago

We really appreciate PaddleDetection team for your brilliant work~

Checklist:

  1. 查找历史相关issue寻求解答/I have searched related issues but cannot get the expected help.
  2. 翻阅FAQ /I have read the FAQ documentation but cannot get the expected help.

描述问题/Describe the bug

请问一下,PP-YOLOE-s的weight_decay参数是在哪里设置的呢? 我在PP-YOLOE的代码文件夹里面搜索了一下,好像没有看到“weight_decay”的相关设置; 期待您的回复!

如果您的issue是关于安装或环境,您可以先查询安装文档尝试解决~

If your issue looks like an installation issue / environment issue, please first try to solve it yourself with the instructions in https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.1/docs/tutorials/INSTALL.md

lyuwenyu commented 2 years ago

yoloe没有设置weight_decay

https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/configs/ppyoloe/_base_/optimizer_300e.yml#L13 如果你想改的话在这里写上 weight_decay: xxx

songyuc commented 2 years ago

yoloe没有设置weight_decay

https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/configs/ppyoloe/_base_/optimizer_300e.yml#L13

如果你想改的话在这里写上 weight_decay: xxx

那PP-YOLOE-S用的是SGD函数中weight_decay的默认值吗?

wangxinxin08 commented 2 years ago

https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/configs/ppyoloe/_base_/optimizer_300e.yml#L17 这里的scale_factor是除了AdamW外的优化器的weight_decay

songyuc commented 2 years ago

https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/configs/ppyoloe/base/optimizer_300e.yml#L17 这里的scale_factor是除了AdamW外的优化器的weight_decay 我有点晕了,PP-YOLOE用的不是带有weight_decay的SGD优化器吗?

wangxinxin08 commented 2 years ago

@songyuc 看下代码https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/ppdet/optimizer.py#L286

songyuc commented 2 years ago

@songyuc 看下代码https://github.com/PaddlePaddle/PaddleDetection/blob/release/2.4/ppdet/optimizer.py#L286

老师,您好,我们看了一下代码发现: 根据代码,PP-YOLOE-s使用的优化器是Momentum,对应的是API -- paddle.optimizer.Momentum,我的问题是:paddle.optimizer.Momentum是否是指带有momentum的SGD算法呢?,这一点我不是很清楚,因为API文档似乎中并没有详细解释Momentum优化器的算法来源? 笔记:L2-regularization和weight_decay的确是等效的。 期待您的解答!

wangxinxin08 commented 2 years ago
  1. momentum = sgd with momentum
  2. l2_factor等效于weight_decay, 除了AdamW算法
songyuc commented 2 years ago
  1. momentum = sgd with momentum
  2. l2_factor等效于weight_decay, 除了AdamW算法

感谢您的解答!