提交 e5cf5fad 编写于 作者: littletomatodonkey's avatar littletomatodonkey

fix decay

上级 20cdde17
......@@ -23,8 +23,7 @@ import paddle.nn as nn
import paddle.nn.functional as F
from paddle.nn import Conv2d, BatchNorm, Linear, Dropout
from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d
# TODO: need to be removed later!
from paddle.fluid.regularizer import L2Decay
from paddle.regularizer import L2Decay
import math
......@@ -194,11 +193,9 @@ class ConvBNLayer(nn.Layer):
num_channels=out_c,
act=None,
param_attr=ParamAttr(
name=name + "_bn_scale",
regularizer=L2Decay(regularization_coeff=0.0)),
name=name + "_bn_scale", regularizer=L2Decay(0.0)),
bias_attr=ParamAttr(
name=name + "_bn_offset",
regularizer=L2Decay(regularization_coeff=0.0)),
name=name + "_bn_offset", regularizer=L2Decay(0.0)),
moving_mean_name=name + "_bn_mean",
moving_variance_name=name + "_bn_variance")
......
......@@ -24,8 +24,7 @@ from paddle import ParamAttr
from paddle.nn.initializer import MSRA
from paddle.nn import Conv2d, BatchNorm, Linear, Dropout
from paddle.nn import AdaptiveAvgPool2d, MaxPool2d, AvgPool2d
# TODO: need to be removed later!
from paddle.fluid.regularizer import L2Decay
from paddle.regularizer import L2Decay
__all__ = ["ResNeSt50_fast_1s1x64d", "ResNeSt50"]
......@@ -58,11 +57,9 @@ class ConvBNLayer(nn.Layer):
num_filters,
act=act,
param_attr=ParamAttr(
name=name + "_scale",
regularizer=L2Decay(regularization_coeff=bn_decay)),
name=name + "_scale", regularizer=L2Decay(bn_decay)),
bias_attr=ParamAttr(
name + "_offset",
regularizer=L2Decay(regularization_coeff=bn_decay)),
name + "_offset", regularizer=L2Decay(bn_decay)),
moving_mean_name=name + "_mean",
moving_variance_name=name + "_variance")
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册