Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
c4653b7e
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看板
提交
c4653b7e
编写于
9月 22, 2022
作者:
G
gaotingquan
提交者:
Tingquan Gao
9月 23, 2022
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
docs: rm wsl from release/2.5
上级
4b591c99
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
0 addition
and
70 deletion
+0
-70
docs/zh_CN/training/advanced/knowledge_distillation.md
docs/zh_CN/training/advanced/knowledge_distillation.md
+0
-70
未找到文件。
docs/zh_CN/training/advanced/knowledge_distillation.md
浏览文件 @
c4653b7e
...
...
@@ -583,76 +583,6 @@ Loss:
weight
:
1.0
```
<<<<<<< HEAD
=======
<a
name=
'1.2.8'
></a>
#### 1.2.8 WSL
##### 1.2.8.1 WSL 算法介绍
论文信息:
> [Rethinking Soft Labels For Knowledge Distillation: A Bias-variance Tradeoff Perspective](https://arxiv.org/abs/2102.0650)
>
> Helong Zhou, Liangchen Song, Jiajie Chen, Ye Zhou, Guoli Wang, Junsong Yuan, Qian Zhang
>
> ICLR, 2021
WSL (Weighted Soft Labels) 损失函数根据教师模型与学生模型关于真值标签的 CE Loss 比值,对每个样本的 KD Loss 分别赋予权重。若学生模型相对教师模型在某个样本上预测结果更好,则对该样本赋予较小的权重。该方法简单、有效,使各个样本的权重可自适应调节,提升了蒸馏精度。
在ImageNet1k公开数据集上,效果如下所示。
| 策略 | 骨干网络 | 配置文件 | Top-1 acc | 下载链接 |
| --- | --- | --- | --- | --- |
| baseline | ResNet18 |
[
ResNet18.yaml
](
../../../../ppcls/configs/ImageNet/ResNet/ResNet18.yaml
)
| 70.8% | - |
| WSL | ResNet18 |
[
resnet34_distill_resnet18_wsl.yaml
](
../../../../ppcls/configs/ImageNet/Distillation/resnet34_distill_resnet18_wsl.yaml
)
| 72.23%(
**+1.43%**
) | - |
##### 1.2.8.2 WSL 配置
WSL 配置如下所示。在模型构建Arch字段中,需要同时定义学生模型与教师模型,教师模型固定参数,且需要加载预训练模型。在损失函数Loss字段中,需要定义
`DistillationGTCELoss`
(学生与真值标签之间的CE loss)以及
`DistillationWSLLoss`
(学生与教师之间的WSL loss),作为训练的损失函数。
```
yaml
# model architecture
Arch
:
name
:
"
DistillationModel"
# if not null, its lengths should be same as models
pretrained_list
:
# if not null, its lengths should be same as models
freeze_params_list
:
-
True
-
False
models
:
-
Teacher
:
name
:
ResNet34
pretrained
:
True
-
Student
:
name
:
ResNet18
pretrained
:
False
infer_model_name
:
"
Student"
# loss function config for traing/eval process
Loss
:
Train
:
-
DistillationGTCELoss
:
weight
:
1.0
model_names
:
[
"
Student"
]
-
DistillationWSLLoss
:
weight
:
2.5
model_name_pairs
:
[[
"
Student"
,
"
Teacher"
]]
temperature
:
2
Eval
:
-
CELoss
:
weight
:
1.0
```
>>>>>>> 1f6f4797 (docs: refactor & fix link & rename)
<a
name=
"2"
></a>
## 2. 模型训练、评估和预测
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录