未验证 提交 8a45b5e0 编写于 作者: T topduke 提交者: GitHub

Fix piecewise boundaries and droppath dtype (#8988)

* fix piecewise boundaries and droppath dtype

* fix tipc piecewise boundaries and droppath dtype
上级 306486e6
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.0005, 0.00005] values : [0.0005, 0.00005]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.001, 0.0001] values : [0.001, 0.0001]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
...@@ -28,7 +28,7 @@ Optimizer: ...@@ -28,7 +28,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.001, 0.0001] values : [0.001, 0.0001]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.001, 0.0001] values : [0.001, 0.0001]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
Global: Global:
use_gpu: True use_gpu: True
epoch_num: 400 epoch_num: 6
log_smooth_window: 20 log_smooth_window: 20
print_batch_step: 10 print_batch_step: 10
save_model_dir: ./output/rec/seed save_model_dir: ./output/rec/seed
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
momentum: 0.9 momentum: 0.9
lr: lr:
name: Piecewise name: Piecewise
decay_epochs: [4,5,8] decay_epochs: [4, 5]
values: [1.0, 0.1, 0.01] values: [1.0, 0.1, 0.01]
regularizer: regularizer:
name: 'L2' name: 'L2'
......
...@@ -32,7 +32,7 @@ def drop_path(x, drop_prob=0., training=False): ...@@ -32,7 +32,7 @@ def drop_path(x, drop_prob=0., training=False):
""" """
if drop_prob == 0. or not training: if drop_prob == 0. or not training:
return x return x
keep_prob = paddle.to_tensor(1 - drop_prob) keep_prob = paddle.to_tensor(1 - drop_prob, dtype=x.dtype)
shape = (paddle.shape(x)[0], ) + (1, ) * (x.ndim - 1) shape = (paddle.shape(x)[0], ) + (1, ) * (x.ndim - 1)
random_tensor = keep_prob + paddle.rand(shape, dtype=x.dtype) random_tensor = keep_prob + paddle.rand(shape, dtype=x.dtype)
random_tensor = paddle.floor(random_tensor) # binarize random_tensor = paddle.floor(random_tensor) # binarize
......
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.001, 0.0001] values : [0.001, 0.0001]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
...@@ -27,7 +27,7 @@ Optimizer: ...@@ -27,7 +27,7 @@ Optimizer:
beta2: 0.999 beta2: 0.999
lr: lr:
name: Piecewise name: Piecewise
decay_epochs : [700, 800] decay_epochs : [700]
values : [0.0005, 0.00005] values : [0.0005, 0.00005]
warmup_epoch: 5 warmup_epoch: 5
regularizer: regularizer:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册