Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

关于scaling Calibration的可学习参数b初始化问题 #1

Closed
MARD1NO opened this issue Apr 12, 2021 · 2 comments
Closed

关于scaling Calibration的可学习参数b初始化问题 #1

MARD1NO opened this issue Apr 12, 2021 · 2 comments

Comments

@MARD1NO
Copy link

MARD1NO commented Apr 12, 2021

您好,我有个问题想问下,关于scaling calibration中,您对偏置b的参数初始化为1,这是有什么根据吗

self.scale_weight.data.fill_(0)
self.scale_bias.data.fill_(1)

因为根据你的公式
image
在限制函数中(沿用你代码的sigmoid函数),你先让可学习参数w初始化为0,那么整个限制函数中一开始就是

R(wb)

而wb一开始为1的时候,对应sigmoid的值约为0.731,把他提到方差外部,则方差变为原始方差的0.73*0.73 = 0.5329,相当于方差减半了。若一开始训练就做这么剧烈的变化,是不是对后续训练有一定影响?

我能理解权重w初始化为0,可以根据centering calibration那一节有

When the absolute value of wm is close to zero, the centering operation still relies on the running statistics.

针对这两个可学习参数的初始值设定,有进行过相关实验探讨吗

@gasvn
Copy link
Member

gasvn commented Apr 12, 2021

你好,你提的这个问题很重要,我们在目前的版本对初始化参数的值还没有太具体的研究,我们会在后续的拓展版加入对初始化参数的研究,感谢你的问题。

在目前版本中,我们在初始化的时候为了尽可能不改变原本bn的初始化分布。wv=0,这样做是ks这一项在一开始不起作用(因为bn本身并没有这个特性);wb=1是随便设了个正值让初始值不是<=0,你提到的问题确实可能会影响训练,我们会尝试下其他的初始化值来进一步验证这个问题。

有后续结果我会在此issue通知你。

@MARD1NO
Copy link
Author

MARD1NO commented Apr 12, 2021

你好,你提的这个问题很重要,我们在目前的版本对初始化参数的值还没有太具体的研究,我们会在后续的拓展版加入对初始化参数的研究,感谢你的问题。

在目前版本中,我们在初始化的时候为了尽可能不改变原本bn的初始化分布。wv=0,这样做是ks这一项在一开始不起作用(因为bn本身并没有这个特性);wb=1是随便设了个正值让初始值不是<=0,你提到的问题确实可能会影响训练,我们会尝试下其他的初始化值来进一步验证这个问题。

有后续结果我会在此issue通知你。

感谢回复!会对后续工作保持关注的~

@gasvn gasvn closed this as completed Sep 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants