Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
e8c3d72b
P
PaddleClas
项目概览
PaddlePaddle
/
PaddleClas
接近 2 年 前同步成功
通知
116
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看板
提交
e8c3d72b
编写于
6月 11, 2020
作者:
W
wqz960
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add ghostnet
上级
5a1c4210
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
2 addition
and
10 deletion
+2
-10
ppcls/modeling/architectures/__init__.py
ppcls/modeling/architectures/__init__.py
+1
-0
ppcls/modeling/architectures/ghostnet.py
ppcls/modeling/architectures/ghostnet.py
+1
-10
未找到文件。
ppcls/modeling/architectures/__init__.py
浏览文件 @
e8c3d72b
...
...
@@ -42,6 +42,7 @@ from .res2net_vd import Res2Net50_vd_48w_2s, Res2Net50_vd_26w_4s, Res2Net50_vd_1
from
.hrnet
import
HRNet_W18_C
,
HRNet_W30_C
,
HRNet_W32_C
,
HRNet_W40_C
,
HRNet_W44_C
,
HRNet_W48_C
,
HRNet_W60_C
,
HRNet_W64_C
,
SE_HRNet_W18_C
,
SE_HRNet_W30_C
,
SE_HRNet_W32_C
,
SE_HRNet_W40_C
,
SE_HRNet_W44_C
,
SE_HRNet_W48_C
,
SE_HRNet_W60_C
,
SE_HRNet_W64_C
from
.darts_gs
import
DARTS_GS_6M
,
DARTS_GS_4M
from
.resnet_acnet
import
ResNet18_ACNet
,
ResNet34_ACNet
,
ResNet50_ACNet
,
ResNet101_ACNet
,
ResNet152_ACNet
from
.ghostnet
import
GhostNet_0_5
,
GhostNet_1_0
,
GhostNet_1_3
# distillation model
from
.distillation_models
import
ResNet50_vd_distill_MobileNetV3_large_x1_0
,
ResNeXt101_32x16d_wsl_distill_ResNet50_vd
...
...
ppcls/modeling/architectures/ghostnet.py
浏览文件 @
e8c3d72b
...
...
@@ -109,10 +109,6 @@ class GhostNet():
initializer
=
fluid
.
initializer
.
Uniform
(
-
stdv
,
stdv
),
name
=
name
+
'_exc_weights'
),
bias_attr
=
ParamAttr
(
name
=
name
+
'_exc_offset'
))
#ones = fluid.layers.fill_constant(excitation.shape, "float32", 1)
#zeros = fluid.layers.fill_constant(excitation.shape, "float32", 0)
#excitation = fluid.layers.elementwise_max(excitation, zeros)
# excitation = fluid.layers.elementwise_min(excitation, ones)
excitation
=
fluid
.
layers
.
clip
(
x
=
excitation
,
min
=
0
,
max
=
1
,
...
...
@@ -167,10 +163,7 @@ class GhostNet():
name
=
name
+
"_cheap_operation"
,
data_format
=
data_format
)
out
=
fluid
.
layers
.
concat
([
primary_conv
,
cheap_operation
],
axis
=
1
,
name
=
name
+
"_concat"
)
# return out[:, :self.oup, :, :]
print
(
self
.
oup
)
print
(
out
.
shape
)
return
fluid
.
layers
.
slice
(
out
,
axes
=
[
1
],
starts
=
[
0
],
ends
=
[
self
.
oup
])
return
out
def
GhostBottleneck
(
self
,
inp
,
...
...
@@ -251,8 +244,6 @@ class GhostNet():
for
k
,
exp_size
,
c
,
use_se
,
s
in
self
.
cfgs
:
output_channel
=
int
(
self
.
_make_divisible
(
c
*
self
.
width_mult
,
4
))
hidden_channel
=
int
(
self
.
_make_divisible
(
exp_size
*
self
.
width_mult
,
4
))
#print(output_channel)
#print(hidden_channel)
x
=
self
.
GhostBottleneck
(
inp
=
x
,
hidden_dim
=
hidden_channel
,
oup
=
output_channel
,
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录