Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
eb6e0d10
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看板
提交
eb6e0d10
编写于
7月 09, 2022
作者:
Y
Yang Nie
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fix typo
上级
62e06ced
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
14 addition
and
14 deletion
+14
-14
ppcls/arch/backbone/model_zoo/peleenet.py
ppcls/arch/backbone/model_zoo/peleenet.py
+14
-14
未找到文件。
ppcls/arch/backbone/model_zoo/peleenet.py
浏览文件 @
eb6e0d10
#
MIT License
#
copyright (c) 2022 PaddlePaddle Authors. All Rights Reserve.
#
#
Copyright (c) Meta Platforms, Inc. and affiliates.
#
MIT License
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
...
...
@@ -55,16 +55,16 @@ class _DenseLayer(nn.Layer):
inter_channel
=
int
(
num_input_features
/
8
)
*
4
print
(
'adjust inter_channel to '
,
inter_channel
)
self
.
branch1a
=
BasicConv2
d
(
self
.
branch1a
=
BasicConv2
D
(
num_input_features
,
inter_channel
,
kernel_size
=
1
)
self
.
branch1b
=
BasicConv2
d
(
self
.
branch1b
=
BasicConv2
D
(
inter_channel
,
growth_rate
,
kernel_size
=
3
,
padding
=
1
)
self
.
branch2a
=
BasicConv2
d
(
self
.
branch2a
=
BasicConv2
D
(
num_input_features
,
inter_channel
,
kernel_size
=
1
)
self
.
branch2b
=
BasicConv2
d
(
self
.
branch2b
=
BasicConv2
D
(
inter_channel
,
growth_rate
,
kernel_size
=
3
,
padding
=
1
)
self
.
branch2c
=
BasicConv2
d
(
self
.
branch2c
=
BasicConv2
D
(
growth_rate
,
growth_rate
,
kernel_size
=
3
,
padding
=
1
)
def
forward
(
self
,
x
):
...
...
@@ -93,13 +93,13 @@ class _StemBlock(nn.Layer):
num_stem_features
=
int
(
num_init_features
/
2
)
self
.
stem1
=
BasicConv2
d
(
self
.
stem1
=
BasicConv2
D
(
num_input_channels
,
num_init_features
,
kernel_size
=
3
,
stride
=
2
,
padding
=
1
)
self
.
stem2a
=
BasicConv2
d
(
self
.
stem2a
=
BasicConv2
D
(
num_init_features
,
num_stem_features
,
kernel_size
=
1
,
stride
=
1
,
padding
=
0
)
self
.
stem2b
=
BasicConv2
d
(
self
.
stem2b
=
BasicConv2
D
(
num_stem_features
,
num_init_features
,
kernel_size
=
3
,
stride
=
2
,
padding
=
1
)
self
.
stem3
=
BasicConv2
d
(
self
.
stem3
=
BasicConv2
D
(
2
*
num_init_features
,
num_init_features
,
kernel_size
=
1
,
stride
=
1
,
padding
=
0
)
self
.
pool
=
nn
.
MaxPool2D
(
kernel_size
=
2
,
stride
=
2
)
...
...
@@ -116,10 +116,10 @@ class _StemBlock(nn.Layer):
return
out
class
BasicConv2
d
(
nn
.
Layer
):
class
BasicConv2
D
(
nn
.
Layer
):
def
__init__
(
self
,
in_channels
,
out_channels
,
activation
=
True
,
**
kwargs
):
super
(
BasicConv2
d
,
self
).
__init__
()
super
(
BasicConv2
D
,
self
).
__init__
()
self
.
conv
=
nn
.
Conv2D
(
in_channels
,
out_channels
,
bias_attr
=
False
,
**
kwargs
)
self
.
norm
=
nn
.
BatchNorm2D
(
out_channels
)
...
...
@@ -184,7 +184,7 @@ class PeleeNetDY(nn.Layer):
setattr
(
self
.
features
,
'denseblock%d'
%
(
i
+
1
),
block
)
num_features
=
num_features
+
num_layers
*
growth_rates
[
i
]
setattr
(
self
.
features
,
'transition%d'
%
(
i
+
1
),
BasicConv2
d
(
setattr
(
self
.
features
,
'transition%d'
%
(
i
+
1
),
BasicConv2
D
(
num_features
,
num_features
,
kernel_size
=
1
,
stride
=
1
,
padding
=
0
))
if
i
!=
len
(
block_config
)
-
1
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录