From 85110108c19328be35f37b2c69a23571bc78dd89 Mon Sep 17 00:00:00 2001 From: Jiancheng Li Date: Tue, 24 Sep 2019 18:07:06 +0800 Subject: [PATCH] Update PaddleSlim LightNAS (#3397) --- PaddleSlim/docs/demo.md | 6 +++--- PaddleSlim/light_nas/light_nas_space.py | 12 ++++++++---- 2 files changed, 11 insertions(+), 7 deletions(-) diff --git a/PaddleSlim/docs/demo.md b/PaddleSlim/docs/demo.md index a810ab02..0ea07eaf 100644 --- a/PaddleSlim/docs/demo.md +++ b/PaddleSlim/docs/demo.md @@ -377,9 +377,9 @@ step9: 执行 `sh run.sh` 进行训练任务。 | - | Latency | Top1/Top5 accuracy | GPU cost | token | |---------------|---------|--------------------|---------------------|--------| | MobileNetV2 | 0% | 71.90% / 90.55% | - | - | -| RK3288 开发板 | -23% | 71.97% / 90.35% | 1.2K GPU hours(V100) | token2 | +| RK3288 开发板 | -22% | 71.97% / 90.35% | 1.2K GPU hours(V100) | token2 | | Android 手机 | -20% | 72.06% / 90.36% | 1.2K GPU hours(V100) | token3 | -| iPhone 手机 | -17% | 72.22% / 90.47% | 1.2K GPU hours(V100) | token4 | +| iPhone 手机 | -16% | 72.22% / 90.47% | 1.2K GPU hours(V100) | token4 | | token name | tokens | @@ -388,4 +388,4 @@ step9: 执行 `sh run.sh` 进行训练任务。 | tokens1 | [3, 1, 1, 0, 1, 0, 3, 2, 1, 0, 1, 1, 0, 1, 1, 1, 1, 0, 2, 0, 1, 0, 1, 0, 1, 1, 1, 0, 1, 1] | | tokens2 | [0, 1, 0, 0, 0, 1, 1, 1, 0, 0, 0, 0, 2, 2, 1, 0, 1, 1, 2, 1, 0, 0, 0, 0, 3, 2, 1, 0, 1, 0] | | tokens3 | [3, 0, 0, 0, 1, 0, 1, 2, 0, 0, 1, 0, 0, 2, 0, 1, 1, 0, 3, 1, 0, 1, 1, 0, 0, 2, 1, 1, 1, 0] | -| tokens4 | [3, 1, 1, 0, 0, 0, 3, 1, 1, 0, 1, 0, 1, 1, 1, 1, 1, 0, 3, 0, 1, 0, 1, 1, 2, 1, 1, 0, 1, 0] | +| tokens4 | [3, 1, 0, 0, 1, 0, 3, 1, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0, 0, 1, 1, 0, 1, 0, 3, 1, 1, 0, 1, 0] | diff --git a/PaddleSlim/light_nas/light_nas_space.py b/PaddleSlim/light_nas/light_nas_space.py index 95062696..f8754138 100644 --- a/PaddleSlim/light_nas/light_nas_space.py +++ b/PaddleSlim/light_nas/light_nas_space.py @@ -23,11 +23,11 @@ import reader from get_ops_from_program import get_ops_from_program total_images = 1281167 -lr = 0.016 -num_epochs = 350 +lr = 0.1 +num_epochs = 240 batch_size = 512 -lr_strategy = "exponential_decay_with_RMSProp" -l2_decay = 1e-5 +lr_strategy = "cosine_decay" +l2_decay = 4e-5 momentum_rate = 0.9 image_shape = [3, 224, 224] class_dim = 1000 @@ -195,6 +195,10 @@ def get_all_ops(ifshortcut=True, ifse=True, strides=[1, 2, 2, 2, 1, 2, 1]): # fc, converted to 1x1 conv op_params.append(('conv', 0, 0, 1, 1280, 1, 1, class_dim, 1, 1, 0, 1, 1)) op_params.append(('eltwise', 2, 1, 1000, 1, 1)) + + op_params.append(('softmax', -1, 1, 1000, 1, 1)) + op_params.append(('eltwise', 1, 1, 1, 1, 1)) + op_params.append(('eltwise', 2, 1, 1, 1, 1)) return list(set(op_params)) -- GitLab