Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PaddleClas
提交
7f55c6e8
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看板
提交
7f55c6e8
编写于
9月 30, 2021
作者:
G
gaotingquan
提交者:
Tingquan Gao
10月 27, 2021
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
refactor: deprecate MixCELoss
上级
c30b72c8
变更
66
隐藏空白更改
内联
并排
Showing
66 changed file
with
131 addition
and
97 deletion
+131
-97
ppcls/configs/ImageNet/DPN/DPN107.yaml
ppcls/configs/ImageNet/DPN/DPN107.yaml
+1
-1
ppcls/configs/ImageNet/DPN/DPN131.yaml
ppcls/configs/ImageNet/DPN/DPN131.yaml
+1
-1
ppcls/configs/ImageNet/DPN/DPN68.yaml
ppcls/configs/ImageNet/DPN/DPN68.yaml
+1
-1
ppcls/configs/ImageNet/DPN/DPN92.yaml
ppcls/configs/ImageNet/DPN/DPN92.yaml
+1
-1
ppcls/configs/ImageNet/DPN/DPN98.yaml
ppcls/configs/ImageNet/DPN/DPN98.yaml
+1
-1
ppcls/configs/ImageNet/DarkNet/DarkNet53.yaml
ppcls/configs/ImageNet/DarkNet/DarkNet53.yaml
+1
-1
ppcls/configs/ImageNet/DataAugment/ResNet50_Cutmix.yaml
ppcls/configs/ImageNet/DataAugment/ResNet50_Cutmix.yaml
+1
-1
ppcls/configs/ImageNet/DataAugment/ResNet50_Mixup.yaml
ppcls/configs/ImageNet/DataAugment/ResNet50_Mixup.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_base_distilled_patch16_224.yaml
...onfigs/ImageNet/DeiT/DeiT_base_distilled_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_base_distilled_patch16_384.yaml
...onfigs/ImageNet/DeiT/DeiT_base_distilled_patch16_384.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_224.yaml
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_384.yaml
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_384.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_small_distilled_patch16_224.yaml
...nfigs/ImageNet/DeiT/DeiT_small_distilled_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_small_patch16_224.yaml
ppcls/configs/ImageNet/DeiT/DeiT_small_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_tiny_distilled_patch16_224.yaml
...onfigs/ImageNet/DeiT/DeiT_tiny_distilled_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/DeiT/DeiT_tiny_patch16_224.yaml
ppcls/configs/ImageNet/DeiT/DeiT_tiny_patch16_224.yaml
+1
-1
ppcls/configs/ImageNet/Inception/InceptionV3.yaml
ppcls/configs/ImageNet/Inception/InceptionV3.yaml
+1
-1
ppcls/configs/ImageNet/Inception/InceptionV4.yaml
ppcls/configs/ImageNet/Inception/InceptionV4.yaml
+1
-1
ppcls/configs/ImageNet/Res2Net/Res2Net101_vd_26w_4s.yaml
ppcls/configs/ImageNet/Res2Net/Res2Net101_vd_26w_4s.yaml
+1
-1
ppcls/configs/ImageNet/Res2Net/Res2Net200_vd_26w_4s.yaml
ppcls/configs/ImageNet/Res2Net/Res2Net200_vd_26w_4s.yaml
+1
-1
ppcls/configs/ImageNet/Res2Net/Res2Net50_14w_8s.yaml
ppcls/configs/ImageNet/Res2Net/Res2Net50_14w_8s.yaml
+1
-1
ppcls/configs/ImageNet/Res2Net/Res2Net50_26w_4s.yaml
ppcls/configs/ImageNet/Res2Net/Res2Net50_26w_4s.yaml
+1
-1
ppcls/configs/ImageNet/Res2Net/Res2Net50_vd_26w_4s.yaml
ppcls/configs/ImageNet/Res2Net/Res2Net50_vd_26w_4s.yaml
+1
-1
ppcls/configs/ImageNet/ResNeSt/ResNeSt101.yaml
ppcls/configs/ImageNet/ResNeSt/ResNeSt101.yaml
+1
-1
ppcls/configs/ImageNet/ResNeSt/ResNeSt50.yaml
ppcls/configs/ImageNet/ResNeSt/ResNeSt50.yaml
+1
-1
ppcls/configs/ImageNet/ResNeSt/ResNeSt50_fast_1s1x64d.yaml
ppcls/configs/ImageNet/ResNeSt/ResNeSt50_fast_1s1x64d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_32x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_64x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_64x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_32x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_64x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_64x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_32x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_64x4d.yaml
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_64x4d.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml
+1
-1
ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml
ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SENet154_vd.yaml
ppcls/configs/ImageNet/SENet/SENet154_vd.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNeXt101_32x4d.yaml
ppcls/configs/ImageNet/SENet/SE_ResNeXt101_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_32x4d.yaml
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_vd_32x4d.yaml
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_vd_32x4d.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNet18_vd.yaml
ppcls/configs/ImageNet/SENet/SE_ResNet18_vd.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNet34_vd.yaml
ppcls/configs/ImageNet/SENet/SE_ResNet34_vd.yaml
+1
-1
ppcls/configs/ImageNet/SENet/SE_ResNet50_vd.yaml
ppcls/configs/ImageNet/SENet/SE_ResNet50_vd.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_base_patch4_window12_384.yaml
...Transformer/SwinTransformer_base_patch4_window12_384.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_base_patch4_window7_224.yaml
...nTransformer/SwinTransformer_base_patch4_window7_224.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_large_patch4_window12_384.yaml
...ransformer/SwinTransformer_large_patch4_window12_384.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_large_patch4_window7_224.yaml
...Transformer/SwinTransformer_large_patch4_window7_224.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_small_patch4_window7_224.yaml
...Transformer/SwinTransformer_small_patch4_window7_224.yaml
+1
-1
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml
...nTransformer/SwinTransformer_tiny_patch4_window7_224.yaml
+1
-1
ppcls/configs/ImageNet/Twins/alt_gvt_base.yaml
ppcls/configs/ImageNet/Twins/alt_gvt_base.yaml
+1
-1
ppcls/configs/ImageNet/Twins/alt_gvt_large.yaml
ppcls/configs/ImageNet/Twins/alt_gvt_large.yaml
+1
-1
ppcls/configs/ImageNet/Twins/alt_gvt_small.yaml
ppcls/configs/ImageNet/Twins/alt_gvt_small.yaml
+1
-1
ppcls/configs/ImageNet/Twins/pcpvt_base.yaml
ppcls/configs/ImageNet/Twins/pcpvt_base.yaml
+1
-1
ppcls/configs/ImageNet/Twins/pcpvt_large.yaml
ppcls/configs/ImageNet/Twins/pcpvt_large.yaml
+1
-1
ppcls/configs/ImageNet/Twins/pcpvt_small.yaml
ppcls/configs/ImageNet/Twins/pcpvt_small.yaml
+1
-1
ppcls/configs/ImageNet/Xception/Xception65.yaml
ppcls/configs/ImageNet/Xception/Xception65.yaml
+1
-1
ppcls/configs/ImageNet/Xception/Xception71.yaml
ppcls/configs/ImageNet/Xception/Xception71.yaml
+1
-1
ppcls/configs/slim/ResNet50_vd_prune.yaml
ppcls/configs/slim/ResNet50_vd_prune.yaml
+1
-1
ppcls/configs/slim/ResNet50_vd_quantization.yaml
ppcls/configs/slim/ResNet50_vd_quantization.yaml
+1
-1
ppcls/data/__init__.py
ppcls/data/__init__.py
+8
-3
ppcls/data/preprocess/batch_ops/batch_operators.py
ppcls/data/preprocess/batch_ops/batch_operators.py
+49
-10
ppcls/engine/engine.py
ppcls/engine/engine.py
+2
-0
ppcls/engine/train/train.py
ppcls/engine/train/train.py
+2
-7
ppcls/loss/celoss.py
ppcls/loss/celoss.py
+9
-16
未找到文件。
ppcls/configs/ImageNet/DPN/DPN107.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DPN/DPN131.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DPN/DPN68.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DPN/DPN92.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DPN/DPN98.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DarkNet/DarkNet53.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DataAugment/ResNet50_Cutmix.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
Eval
:
-
CELoss
:
...
...
ppcls/configs/ImageNet/DataAugment/ResNet50_Mixup.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
Eval
:
-
CELoss
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_base_distilled_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_base_distilled_patch16_384.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_base_patch16_384.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_small_distilled_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_small_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_tiny_distilled_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/DeiT/DeiT_tiny_patch16_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Inception/InceptionV3.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Inception/InceptionV4.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Res2Net/Res2Net101_vd_26w_4s.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Res2Net/Res2Net200_vd_26w_4s.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Res2Net/Res2Net50_14w_8s.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Res2Net/Res2Net50_26w_4s.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Res2Net/Res2Net50_vd_26w_4s.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeSt/ResNeSt101.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeSt/ResNeSt50.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeSt/ResNeSt50_fast_1s1x64d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt101_vd_64x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt152_vd_64x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNeXt/ResNeXt50_vd_64x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet101_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet152_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet18_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet200_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet34_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/ResNet/ResNet50_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SENet154_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNeXt101_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNeXt50_vd_32x4d.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNet18_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNet34_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SENet/SE_ResNet50_vd.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_base_patch4_window12_384.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_base_patch4_window7_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_large_patch4_window12_384.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_large_patch4_window7_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_small_patch4_window7_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/SwinTransformer/SwinTransformer_tiny_patch4_window7_224.yaml
浏览文件 @
7f55c6e8
...
...
@@ -24,7 +24,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/alt_gvt_base.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/alt_gvt_large.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/alt_gvt_small.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/pcpvt_base.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/pcpvt_large.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Twins/pcpvt_small.yaml
浏览文件 @
7f55c6e8
...
...
@@ -26,7 +26,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Xception/Xception65.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/ImageNet/Xception/Xception71.yaml
浏览文件 @
7f55c6e8
...
...
@@ -22,7 +22,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/slim/ResNet50_vd_prune.yaml
浏览文件 @
7f55c6e8
...
...
@@ -30,7 +30,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/configs/slim/ResNet50_vd_quantization.yaml
浏览文件 @
7f55c6e8
...
...
@@ -29,7 +29,7 @@ Arch:
# loss function config for traing/eval process
Loss
:
Train
:
-
Mix
CELoss
:
-
CELoss
:
weight
:
1.0
epsilon
:
0.1
Eval
:
...
...
ppcls/data/__init__.py
浏览文件 @
7f55c6e8
...
...
@@ -12,6 +12,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
inspect
import
copy
import
paddle
import
numpy
as
np
...
...
@@ -36,7 +37,7 @@ from ppcls.data import preprocess
from
ppcls.data.preprocess
import
transform
def
create_operators
(
params
):
def
create_operators
(
params
,
class_num
=
None
):
"""
create operators based on the config
...
...
@@ -50,7 +51,10 @@ def create_operators(params):
dict
)
and
len
(
operator
)
==
1
,
"yaml format error"
op_name
=
list
(
operator
)[
0
]
param
=
{}
if
operator
[
op_name
]
is
None
else
operator
[
op_name
]
op
=
getattr
(
preprocess
,
op_name
)(
**
param
)
op_func
=
getattr
(
preprocess
,
op_name
)
if
"class_num"
in
inspect
.
getfullargspec
(
op_func
).
args
:
param
.
update
({
"class_num"
:
class_num
})
op
=
op_func
(
**
param
)
ops
.
append
(
op
)
return
ops
...
...
@@ -65,6 +69,7 @@ def build_dataloader(config, mode, device, use_dali=False, seed=None):
from
ppcls.data.dataloader.dali
import
dali_dataloader
return
dali_dataloader
(
config
,
mode
,
paddle
.
device
.
get_device
(),
seed
)
class_num
=
config
.
get
(
"class_num"
,
None
)
config_dataset
=
config
[
mode
][
'dataset'
]
config_dataset
=
copy
.
deepcopy
(
config_dataset
)
dataset_name
=
config_dataset
.
pop
(
'name'
)
...
...
@@ -104,7 +109,7 @@ def build_dataloader(config, mode, device, use_dali=False, seed=None):
return
[
np
.
stack
(
slot
,
axis
=
0
)
for
slot
in
slots
]
if
isinstance
(
batch_transform
,
list
):
batch_ops
=
create_operators
(
batch_transform
)
batch_ops
=
create_operators
(
batch_transform
,
class_num
)
batch_collate_fn
=
mix_collate_fn
else
:
batch_collate_fn
=
None
...
...
ppcls/data/preprocess/batch_ops/batch_operators.py
浏览文件 @
7f55c6e8
...
...
@@ -44,6 +44,14 @@ class BatchOperator(object):
labels
.
append
(
item
[
1
])
return
np
.
array
(
imgs
),
np
.
array
(
labels
),
bs
def
_one_hot
(
self
,
targets
):
return
np
.
eye
(
self
.
class_num
,
dtype
=
"float32"
)[
targets
]
def
_mix_target
(
self
,
targets0
,
targets1
,
lam
):
one_hots0
=
self
.
_one_hot
(
targets0
)
one_hots1
=
self
.
_one_hot
(
targets1
)
return
one_hots0
*
lam
+
one_hots1
*
(
1
-
lam
)
def
__call__
(
self
,
batch
):
return
batch
...
...
@@ -51,7 +59,7 @@ class BatchOperator(object):
class
MixupOperator
(
BatchOperator
):
""" Mixup operator """
def
__init__
(
self
,
alpha
:
float
=
1.
):
def
__init__
(
self
,
class_num
,
alpha
:
float
=
1.
):
"""Build Mixup operator
Args:
...
...
@@ -64,21 +72,27 @@ class MixupOperator(BatchOperator):
raise
Exception
(
f
"Parameter
\"
alpha
\"
of Mixup should be greater than 0.
\"
alpha
\"
:
{
alpha
}
."
)
if
not
class_num
:
msg
=
"Please set
\"
Arch.class_num
\"
in config if use
\"
MixupOperator
\"
."
logger
.
error
(
Exception
(
msg
))
raise
Exception
(
msg
)
self
.
_alpha
=
alpha
self
.
class_num
=
class_num
def
__call__
(
self
,
batch
):
imgs
,
labels
,
bs
=
self
.
_unpack
(
batch
)
idx
=
np
.
random
.
permutation
(
bs
)
lam
=
np
.
random
.
beta
(
self
.
_alpha
,
self
.
_alpha
)
lams
=
np
.
array
([
lam
]
*
bs
,
dtype
=
np
.
float32
)
imgs
=
lam
*
imgs
+
(
1
-
lam
)
*
imgs
[
idx
]
return
list
(
zip
(
imgs
,
labels
,
labels
[
idx
],
lams
))
targets
=
self
.
_mix_target
(
labels
,
labels
[
idx
],
lam
)
return
list
(
zip
(
imgs
,
targets
))
class
CutmixOperator
(
BatchOperator
):
""" Cutmix operator """
def
__init__
(
self
,
alpha
=
0.2
):
def
__init__
(
self
,
class_num
,
alpha
=
0.2
):
"""Build Cutmix operator
Args:
...
...
@@ -91,7 +105,13 @@ class CutmixOperator(BatchOperator):
raise
Exception
(
f
"Parameter
\"
alpha
\"
of Cutmix should be greater than 0.
\"
alpha
\"
:
{
alpha
}
."
)
if
not
class_num
:
msg
=
"Please set
\"
Arch.class_num
\"
in config if use
\"
CutmixOperator
\"
."
logger
.
error
(
Exception
(
msg
))
raise
Exception
(
msg
)
self
.
_alpha
=
alpha
self
.
class_num
=
class_num
def
_rand_bbox
(
self
,
size
,
lam
):
""" _rand_bbox """
...
...
@@ -121,18 +141,29 @@ class CutmixOperator(BatchOperator):
imgs
[:,
:,
bbx1
:
bbx2
,
bby1
:
bby2
]
=
imgs
[
idx
,
:,
bbx1
:
bbx2
,
bby1
:
bby2
]
lam
=
1
-
(
float
(
bbx2
-
bbx1
)
*
(
bby2
-
bby1
)
/
(
imgs
.
shape
[
-
2
]
*
imgs
.
shape
[
-
1
]))
lams
=
np
.
array
([
lam
]
*
bs
,
dtype
=
np
.
float32
)
return
list
(
zip
(
imgs
,
labels
,
labels
[
idx
],
lam
s
))
targets
=
self
.
_mix_target
(
labels
,
labels
[
idx
],
lam
)
return
list
(
zip
(
imgs
,
target
s
))
class
FmixOperator
(
BatchOperator
):
""" Fmix operator """
def
__init__
(
self
,
alpha
=
1
,
decay_power
=
3
,
max_soft
=
0.
,
reformulate
=
False
):
def
__init__
(
self
,
class_num
,
alpha
=
1
,
decay_power
=
3
,
max_soft
=
0.
,
reformulate
=
False
):
if
not
class_num
:
msg
=
"Please set
\"
Arch.class_num
\"
in config if use
\"
FmixOperator
\"
."
logger
.
error
(
Exception
(
msg
))
raise
Exception
(
msg
)
self
.
_alpha
=
alpha
self
.
_decay_power
=
decay_power
self
.
_max_soft
=
max_soft
self
.
_reformulate
=
reformulate
self
.
class_num
=
class_num
def
__call__
(
self
,
batch
):
imgs
,
labels
,
bs
=
self
.
_unpack
(
batch
)
...
...
@@ -141,20 +172,27 @@ class FmixOperator(BatchOperator):
lam
,
mask
=
sample_mask
(
self
.
_alpha
,
self
.
_decay_power
,
\
size
,
self
.
_max_soft
,
self
.
_reformulate
)
imgs
=
mask
*
imgs
+
(
1
-
mask
)
*
imgs
[
idx
]
return
list
(
zip
(
imgs
,
labels
,
labels
[
idx
],
[
lam
]
*
bs
))
targets
=
self
.
_mix_target
(
labels
,
labels
[
idx
],
lam
)
return
list
(
zip
(
imgs
,
targets
))
class
OpSampler
(
object
):
""" Sample a operator from """
def
__init__
(
self
,
**
op_dict
):
def
__init__
(
self
,
class_num
,
**
op_dict
):
"""Build OpSampler
Raises:
Exception: The parameter
\"
prob
\"
of operator(s) are be set error.
"""
if
not
class_num
:
msg
=
"Please set
\"
Arch.class_num
\"
in config if use
\"
OpSampler
\"
."
logger
.
error
(
Exception
(
msg
))
raise
Exception
(
msg
)
if
len
(
op_dict
)
<
1
:
msg
=
f
"ConfigWarning: No operator in
\"
OpSampler
\"
.
\"
OpSampler
\"
has been skipped."
logger
.
warning
(
msg
)
self
.
ops
=
{}
total_prob
=
0
...
...
@@ -165,12 +203,13 @@ class OpSampler(object):
logger
.
warning
(
msg
)
prob
=
param
.
pop
(
"prob"
,
0
)
total_prob
+=
prob
param
.
update
({
"class_num"
:
class_num
})
op
=
eval
(
op_name
)(
**
param
)
self
.
ops
.
update
({
op
:
prob
})
if
total_prob
>
1
:
msg
=
f
"ConfigError: The total prob of operators in
\"
OpSampler
\"
should be less 1."
logger
.
error
(
msg
)
logger
.
error
(
Exception
(
msg
)
)
raise
Exception
(
msg
)
# add "None Op" when total_prob < 1, "None Op" do nothing
...
...
ppcls/engine/engine.py
浏览文件 @
7f55c6e8
...
...
@@ -112,6 +112,8 @@ class Engine(object):
}
paddle
.
fluid
.
set_flags
(
AMP_RELATED_FLAGS_SETTING
)
class_num
=
config
[
"Arch"
].
get
(
"class_num"
,
None
)
self
.
config
[
"DataLoader"
].
update
({
"class_num"
:
class_num
})
# build dataloader
if
self
.
mode
==
'train'
:
self
.
train_dataloader
=
build_dataloader
(
...
...
ppcls/engine/train/train.py
浏览文件 @
7f55c6e8
...
...
@@ -34,7 +34,7 @@ def train_epoch(engine, epoch_id, print_batch_step):
]
batch_size
=
batch
[
0
].
shape
[
0
]
if
not
engine
.
config
[
"Global"
].
get
(
"use_multilabel"
,
False
):
batch
[
1
]
=
batch
[
1
].
reshape
([
-
1
,
1
]).
astype
(
"int64"
)
batch
[
1
]
=
batch
[
1
].
reshape
([
batch_size
,
-
1
]
)
engine
.
global_step
+=
1
# image input
...
...
@@ -47,12 +47,7 @@ def train_epoch(engine, epoch_id, print_batch_step):
else
:
out
=
forward
(
engine
,
batch
)
# calc loss
if
engine
.
config
[
"DataLoader"
][
"Train"
][
"dataset"
].
get
(
"batch_transform_ops"
,
None
):
loss_dict
=
engine
.
train_loss_func
(
out
,
batch
[
1
:])
else
:
loss_dict
=
engine
.
train_loss_func
(
out
,
batch
[
1
])
loss_dict
=
engine
.
train_loss_func
(
out
,
batch
[
1
])
# step opt and lr
if
engine
.
amp
:
...
...
ppcls/loss/celoss.py
浏览文件 @
7f55c6e8
...
...
@@ -12,10 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.
import
warnings
import
paddle
import
paddle.nn
as
nn
import
paddle.nn.functional
as
F
from
ppcls.utils
import
logger
class
CELoss
(
nn
.
Layer
):
"""
...
...
@@ -56,19 +60,8 @@ class CELoss(nn.Layer):
return
{
"CELoss"
:
loss
}
class
MixCELoss
(
CELoss
):
"""
Cross entropy loss with mix(mixup, cutmix, fixmix)
"""
def
__init__
(
self
,
epsilon
=
None
):
super
().
__init__
()
self
.
epsilon
=
epsilon
def
__call__
(
self
,
input
,
batch
):
target0
,
target1
,
lam
=
batch
loss0
=
super
().
forward
(
input
,
target0
)[
"CELoss"
]
loss1
=
super
().
forward
(
input
,
target1
)[
"CELoss"
]
loss
=
lam
*
loss0
+
(
1.0
-
lam
)
*
loss1
loss
=
paddle
.
mean
(
loss
)
return
{
"MixCELoss"
:
loss
}
class
MixCELoss
(
object
):
def
__init__
(
self
,
*
args
,
**
kwargs
):
msg
=
"
\"
MixCELos
\"
is deprecated, please use
\"
CELoss
\"
instead."
logger
.
error
(
DeprecationWarning
(
msg
))
raise
DeprecationWarning
(
msg
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录