提交 248d59c2 编写于 作者: W wuzewu

Add msra init

上级 39acea01
......@@ -23,3 +23,8 @@ def constant_init(param, **kwargs):
def normal_init(param, **kwargs):
initializer = fluid.initializer.Normal(**kwargs)
initializer(param, param.block)
def msra_init(param, **kwargs):
initializer = fluid.initializer.MSRA(**kwargs)
initializer(param, param.block)
......@@ -259,7 +259,7 @@ class BiSeNet(nn.Layer):
else:
for sublayer in self.sublayers():
if isinstance(sublayer, nn.Conv2d):
param_init.normal_init(sublayer.weight, scale=0.001)
param_init.msra_init(sublayer.weight)
elif isinstance(sublayer, nn.SyncBatchNorm):
param_init.constant_init(sublayer.weight, value=1.0)
param_init.constant_init(sublayer.bias, value=0.0)
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册