Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
e0a6e5bf
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看板
未验证
提交
e0a6e5bf
编写于
1月 06, 2022
作者:
littletomatodonkey
提交者:
GitHub
1月 06, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
fox dist err (#1621)
* fox dist err * fix init * fix init
上级
aea712cc
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
6 addition
and
15 deletion
+6
-15
ppcls/arch/__init__.py
ppcls/arch/__init__.py
+2
-5
ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_dml.yaml
...neralRecognition/GeneralRecognition_PPLCNet_x2_5_dml.yaml
+0
-6
ppcls/configs/ImageNet/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
...t/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
+1
-1
ppcls/loss/distillationloss.py
ppcls/loss/distillationloss.py
+1
-1
ppcls/loss/dmlloss.py
ppcls/loss/dmlloss.py
+2
-2
未找到文件。
ppcls/arch/__init__.py
浏览文件 @
e0a6e5bf
...
@@ -28,7 +28,6 @@ from ppcls.utils import logger
...
@@ -28,7 +28,6 @@ from ppcls.utils import logger
from
ppcls.utils.save_load
import
load_dygraph_pretrain
from
ppcls.utils.save_load
import
load_dygraph_pretrain
from
ppcls.arch.slim
import
prune_model
,
quantize_model
from
ppcls.arch.slim
import
prune_model
,
quantize_model
__all__
=
[
"build_model"
,
"RecModel"
,
"DistillationModel"
]
__all__
=
[
"build_model"
,
"RecModel"
,
"DistillationModel"
]
...
@@ -82,13 +81,11 @@ class RecModel(TheseusLayer):
...
@@ -82,13 +81,11 @@ class RecModel(TheseusLayer):
out
[
"backbone"
]
=
x
out
[
"backbone"
]
=
x
if
self
.
neck
is
not
None
:
if
self
.
neck
is
not
None
:
x
=
self
.
neck
(
x
)
x
=
self
.
neck
(
x
)
out
[
"neck"
]
=
x
out
[
"features"
]
=
x
out
[
"features"
]
=
x
if
self
.
head
is
not
None
:
if
self
.
head
is
not
None
:
y
=
self
.
head
(
x
,
label
)
y
=
self
.
head
(
x
,
label
)
out
[
"neck"
]
=
x
out
[
"logits"
]
=
y
else
:
y
=
None
out
[
"logits"
]
=
y
return
out
return
out
...
...
ppcls/configs/GeneralRecognition/GeneralRecognition_PPLCNet_x2_5_dml.yaml
浏览文件 @
e0a6e5bf
# global configs
# global configs
# global configs
Global
:
Global
:
checkpoints
:
null
checkpoints
:
null
pretrained_model
:
null
pretrained_model
:
null
...
@@ -85,11 +84,6 @@ Loss:
...
@@ -85,11 +84,6 @@ Loss:
key
:
"
logits"
key
:
"
logits"
model_name_pairs
:
model_name_pairs
:
-
[
"
Student"
,
"
Teacher"
]
-
[
"
Student"
,
"
Teacher"
]
-
DistillationDMLLoss
:
weight
:
1.0
key
:
"
logits"
model_name_pairs
:
-
[
"
Student"
,
"
Teacher"
]
Eval
:
Eval
:
-
DistillationGTCELoss
:
-
DistillationGTCELoss
:
weight
:
1.0
weight
:
1.0
...
...
ppcls/configs/ImageNet/Distillation/mv3_large_x1_0_distill_mv3_small_x1_0.yaml
浏览文件 @
e0a6e5bf
...
@@ -57,7 +57,7 @@ Optimizer:
...
@@ -57,7 +57,7 @@ Optimizer:
momentum
:
0.9
momentum
:
0.9
lr
:
lr
:
name
:
Cosine
name
:
Cosine
learning_rate
:
1.3
learning_rate
:
0.65
warmup_epoch
:
5
warmup_epoch
:
5
regularizer
:
regularizer
:
name
:
'
L2'
name
:
'
L2'
...
...
ppcls/loss/distillationloss.py
浏览文件 @
e0a6e5bf
...
@@ -69,7 +69,7 @@ class DistillationGTCELoss(CELoss):
...
@@ -69,7 +69,7 @@ class DistillationGTCELoss(CELoss):
def
forward
(
self
,
predicts
,
batch
):
def
forward
(
self
,
predicts
,
batch
):
loss_dict
=
dict
()
loss_dict
=
dict
()
for
_
,
name
in
enumerate
(
self
.
model_names
)
:
for
name
in
self
.
model_names
:
out
=
predicts
[
name
]
out
=
predicts
[
name
]
if
self
.
key
is
not
None
:
if
self
.
key
is
not
None
:
out
=
out
[
self
.
key
]
out
=
out
[
self
.
key
]
...
...
ppcls/loss/dmlloss.py
浏览文件 @
e0a6e5bf
...
@@ -42,8 +42,8 @@ class DMLLoss(nn.Layer):
...
@@ -42,8 +42,8 @@ class DMLLoss(nn.Layer):
def
forward
(
self
,
x
,
target
):
def
forward
(
self
,
x
,
target
):
if
self
.
act
is
not
None
:
if
self
.
act
is
not
None
:
x
=
F
.
softmax
(
x
)
x
=
self
.
act
(
x
)
target
=
F
.
softmax
(
target
)
target
=
self
.
act
(
target
)
loss
=
self
.
_kldiv
(
x
,
target
)
+
self
.
_kldiv
(
target
,
x
)
loss
=
self
.
_kldiv
(
x
,
target
)
+
self
.
_kldiv
(
target
,
x
)
loss
=
loss
/
2
loss
=
loss
/
2
loss
=
paddle
.
mean
(
loss
)
loss
=
paddle
.
mean
(
loss
)
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录