Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
032c45c1
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
大约 1 年 前同步成功
通知
115
Star
4999
Fork
1114
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
19
列表
看板
标记
里程碑
合并请求
6
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PaddleClas
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
19
Issue
19
列表
看板
标记
里程碑
合并请求
6
合并请求
6
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
032c45c1
编写于
5月 18, 2022
作者:
Z
zhiboniu
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
delete norm_decay in resnet
上级
05ecf1d0
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
22 deletion
+2
-22
ppcls/arch/backbone/legendary_models/resnet.py
ppcls/arch/backbone/legendary_models/resnet.py
+2
-21
ppcls/configs/Attr/StrongBaselineAttr.yaml
ppcls/configs/Attr/StrongBaselineAttr.yaml
+0
-1
未找到文件。
ppcls/arch/backbone/legendary_models/resnet.py
浏览文件 @
032c45c1
...
...
@@ -117,7 +117,6 @@ class ConvBNLayer(TheseusLayer):
is_vd_mode
=
False
,
act
=
None
,
lr_mult
=
1.0
,
norm_decay
=
0.
,
data_format
=
"NCHW"
):
super
().
__init__
()
self
.
is_vd_mode
=
is_vd_mode
...
...
@@ -135,14 +134,8 @@ class ConvBNLayer(TheseusLayer):
bias_attr
=
False
,
data_format
=
data_format
)
weight_attr
=
ParamAttr
(
learning_rate
=
lr_mult
,
regularizer
=
L2Decay
(
norm_decay
),
trainable
=
True
)
bias_attr
=
ParamAttr
(
learning_rate
=
lr_mult
,
regularizer
=
L2Decay
(
norm_decay
),
trainable
=
True
)
weight_attr
=
ParamAttr
(
learning_rate
=
lr_mult
,
trainable
=
True
)
bias_attr
=
ParamAttr
(
learning_rate
=
lr_mult
,
trainable
=
True
)
self
.
bn
=
BatchNorm2D
(
num_filters
,
weight_attr
=
weight_attr
,
bias_attr
=
bias_attr
)
...
...
@@ -166,7 +159,6 @@ class BottleneckBlock(TheseusLayer):
shortcut
=
True
,
if_first
=
False
,
lr_mult
=
1.0
,
norm_decay
=
0.
,
data_format
=
"NCHW"
):
super
().
__init__
()
...
...
@@ -176,7 +168,6 @@ class BottleneckBlock(TheseusLayer):
filter_size
=
1
,
act
=
"relu"
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
self
.
conv1
=
ConvBNLayer
(
num_channels
=
num_filters
,
...
...
@@ -185,7 +176,6 @@ class BottleneckBlock(TheseusLayer):
stride
=
stride
,
act
=
"relu"
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
self
.
conv2
=
ConvBNLayer
(
num_channels
=
num_filters
,
...
...
@@ -193,7 +183,6 @@ class BottleneckBlock(TheseusLayer):
filter_size
=
1
,
act
=
None
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
if
not
shortcut
:
...
...
@@ -204,7 +193,6 @@ class BottleneckBlock(TheseusLayer):
stride
=
stride
if
if_first
else
1
,
is_vd_mode
=
False
if
if_first
else
True
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
self
.
relu
=
nn
.
ReLU
()
...
...
@@ -233,7 +221,6 @@ class BasicBlock(TheseusLayer):
shortcut
=
True
,
if_first
=
False
,
lr_mult
=
1.0
,
norm_decay
=
0.
,
data_format
=
"NCHW"
):
super
().
__init__
()
...
...
@@ -245,7 +232,6 @@ class BasicBlock(TheseusLayer):
stride
=
stride
,
act
=
"relu"
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
self
.
conv1
=
ConvBNLayer
(
num_channels
=
num_filters
,
...
...
@@ -253,7 +239,6 @@ class BasicBlock(TheseusLayer):
filter_size
=
3
,
act
=
None
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
if
not
shortcut
:
self
.
short
=
ConvBNLayer
(
...
...
@@ -263,7 +248,6 @@ class BasicBlock(TheseusLayer):
stride
=
stride
if
if_first
else
1
,
is_vd_mode
=
False
if
if_first
else
True
,
lr_mult
=
lr_mult
,
norm_decay
=
norm_decay
,
data_format
=
data_format
)
self
.
shortcut
=
shortcut
self
.
relu
=
nn
.
ReLU
()
...
...
@@ -300,7 +284,6 @@ class ResNet(TheseusLayer):
stem_act
=
"relu"
,
class_num
=
1000
,
lr_mult_list
=
[
1.0
,
1.0
,
1.0
,
1.0
,
1.0
],
norm_decay
=
0.
,
data_format
=
"NCHW"
,
input_image_channel
=
3
,
return_patterns
=
None
,
...
...
@@ -340,7 +323,6 @@ class ResNet(TheseusLayer):
stride
=
s
,
act
=
stem_act
,
lr_mult
=
self
.
lr_mult_list
[
0
],
norm_decay
=
norm_decay
,
data_format
=
data_format
)
for
in_c
,
out_c
,
k
,
s
in
self
.
stem_cfg
[
version
]
])
...
...
@@ -359,7 +341,6 @@ class ResNet(TheseusLayer):
shortcut
=
shortcut
,
if_first
=
block_idx
==
i
==
0
if
version
==
"vd"
else
True
,
lr_mult
=
self
.
lr_mult_list
[
block_idx
+
1
],
norm_decay
=
norm_decay
,
data_format
=
data_format
))
shortcut
=
True
self
.
blocks
=
nn
.
Sequential
(
*
block_list
)
...
...
ppcls/configs/Attr/StrongBaselineAttr.yaml
浏览文件 @
032c45c1
...
...
@@ -20,7 +20,6 @@ Arch:
name
:
"
ResNet50"
pretrained
:
True
class_num
:
26
norm_decay
:
0.0005
# loss function config for traing/eval process
Loss
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录