Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
95ed78e2
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看板
未验证
提交
95ed78e2
编写于
8月 04, 2020
作者:
L
littletomatodonkey
提交者:
GitHub
8月 04, 2020
浏览文件
操作
浏览文件
下载
差异文件
Merge pull request #237 from littletomatodonkey/fix_other_typo
fix typo
上级
3f4ed217
87b33f29
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
20 addition
and
16 deletion
+20
-16
ppcls/modeling/architectures/resnet.py
ppcls/modeling/architectures/resnet.py
+5
-5
ppcls/modeling/architectures/resnet_vc.py
ppcls/modeling/architectures/resnet_vc.py
+5
-5
ppcls/modeling/architectures/se_resnet_vd.py
ppcls/modeling/architectures/se_resnet_vd.py
+10
-6
未找到文件。
ppcls/modeling/architectures/resnet.py
浏览文件 @
95ed78e2
...
...
@@ -124,14 +124,14 @@ class BottleneckBlock(fluid.dygraph.Layer):
return
layer_helper
.
append_activation
(
y
)
class
B
i
sicBlock
(
fluid
.
dygraph
.
Layer
):
class
B
a
sicBlock
(
fluid
.
dygraph
.
Layer
):
def
__init__
(
self
,
num_channels
,
num_filters
,
stride
,
shortcut
=
True
,
name
=
None
):
super
(
B
i
sicBlock
,
self
).
__init__
()
super
(
B
a
sicBlock
,
self
).
__init__
()
self
.
stride
=
stride
self
.
conv0
=
ConvBNLayer
(
num_channels
=
num_channels
,
...
...
@@ -231,16 +231,16 @@ class ResNet(fluid.dygraph.Layer):
shortcut
=
False
for
i
in
range
(
depth
[
block
]):
conv_name
=
"res"
+
str
(
block
+
2
)
+
chr
(
97
+
i
)
b
i
sic_block
=
self
.
add_sublayer
(
b
a
sic_block
=
self
.
add_sublayer
(
conv_name
,
B
i
sicBlock
(
B
a
sicBlock
(
num_channels
=
num_channels
[
block
]
if
i
==
0
else
num_filters
[
block
],
num_filters
=
num_filters
[
block
],
stride
=
2
if
i
==
0
and
block
!=
0
else
1
,
shortcut
=
shortcut
,
name
=
conv_name
))
self
.
block_list
.
append
(
b
i
sic_block
)
self
.
block_list
.
append
(
b
a
sic_block
)
shortcut
=
True
self
.
pool2d_avg
=
Pool2D
(
...
...
ppcls/modeling/architectures/resnet_vc.py
浏览文件 @
95ed78e2
...
...
@@ -126,14 +126,14 @@ class BottleneckBlock(fluid.dygraph.Layer):
return
layer_helper
.
append_activation
(
y
)
class
B
i
sicBlock
(
fluid
.
dygraph
.
Layer
):
class
B
a
sicBlock
(
fluid
.
dygraph
.
Layer
):
def
__init__
(
self
,
num_channels
,
num_filters
,
stride
,
shortcut
=
True
,
name
=
None
):
super
(
B
i
sicBlock
,
self
).
__init__
()
super
(
B
a
sicBlock
,
self
).
__init__
()
self
.
stride
=
stride
self
.
conv0
=
ConvBNLayer
(
num_channels
=
num_channels
,
...
...
@@ -248,16 +248,16 @@ class ResNet_vc(fluid.dygraph.Layer):
shortcut
=
False
for
i
in
range
(
depth
[
block
]):
conv_name
=
"res"
+
str
(
block
+
2
)
+
chr
(
97
+
i
)
b
i
sic_block
=
self
.
add_sublayer
(
b
a
sic_block
=
self
.
add_sublayer
(
'bb_%d_%d'
%
(
block
,
i
),
B
i
sicBlock
(
B
a
sicBlock
(
num_channels
=
num_channels
[
block
]
if
i
==
0
else
num_filters
[
block
],
num_filters
=
num_filters
[
block
],
stride
=
2
if
i
==
0
and
block
!=
0
else
1
,
shortcut
=
shortcut
,
name
=
conv_name
))
self
.
block_list
.
append
(
b
i
sic_block
)
self
.
block_list
.
append
(
b
a
sic_block
)
shortcut
=
True
self
.
pool2d_avg
=
Pool2D
(
...
...
ppcls/modeling/architectures/se_resnet_vd.py
浏览文件 @
95ed78e2
...
...
@@ -45,7 +45,11 @@ class ConvBNLayer(fluid.dygraph.Layer):
self
.
is_vd_mode
=
is_vd_mode
self
.
_pool2d_avg
=
Pool2D
(
pool_size
=
2
,
pool_stride
=
2
,
pool_padding
=
0
,
pool_type
=
'avg'
,
ceil_mode
=
True
)
pool_size
=
2
,
pool_stride
=
2
,
pool_padding
=
0
,
pool_type
=
'avg'
,
ceil_mode
=
True
)
self
.
_conv
=
Conv2D
(
num_channels
=
num_channels
,
num_filters
=
num_filters
,
...
...
@@ -139,7 +143,7 @@ class BottleneckBlock(fluid.dygraph.Layer):
return
layer_helper
.
append_activation
(
y
)
class
B
i
sicBlock
(
fluid
.
dygraph
.
Layer
):
class
B
a
sicBlock
(
fluid
.
dygraph
.
Layer
):
def
__init__
(
self
,
num_channels
,
num_filters
,
...
...
@@ -148,7 +152,7 @@ class BisicBlock(fluid.dygraph.Layer):
if_first
=
False
,
reduction_ratio
=
16
,
name
=
None
):
super
(
B
i
sicBlock
,
self
).
__init__
()
super
(
B
a
sicBlock
,
self
).
__init__
()
self
.
stride
=
stride
self
.
conv0
=
ConvBNLayer
(
num_channels
=
num_channels
,
...
...
@@ -313,9 +317,9 @@ class SE_ResNet_vd(fluid.dygraph.Layer):
shortcut
=
False
for
i
in
range
(
depth
[
block
]):
conv_name
=
"res"
+
str
(
block
+
2
)
+
chr
(
97
+
i
)
b
i
sic_block
=
self
.
add_sublayer
(
b
a
sic_block
=
self
.
add_sublayer
(
'bb_%d_%d'
%
(
block
,
i
),
B
i
sicBlock
(
B
a
sicBlock
(
num_channels
=
num_channels
[
block
]
if
i
==
0
else
num_filters
[
block
],
num_filters
=
num_filters
[
block
],
...
...
@@ -323,7 +327,7 @@ class SE_ResNet_vd(fluid.dygraph.Layer):
shortcut
=
shortcut
,
if_first
=
block
==
i
==
0
,
name
=
conv_name
))
self
.
block_list
.
append
(
b
i
sic_block
)
self
.
block_list
.
append
(
b
a
sic_block
)
shortcut
=
True
self
.
pool2d_avg
=
Pool2D
(
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录