polynomial_decay

paddle.fluid.layers.polynomial_decay(learning_rate, decay_steps, end_learning_rate=0.0001, power=1.0, cycle=False)[source]

Applies polynomial decay to the initial learning rate.

if cycle:
  decay_steps = decay_steps * ceil(global_step / decay_steps)
else:
  global_step = min(global_step, decay_steps)
  decayed_learning_rate = (learning_rate - end_learning_rate) *
       (1 - global_step / decay_steps) ^ power + end_learning_rate
Parameters
  • learning_rate (Variable|float32) – A scalar float32 value or a Variable. This will be the initial learning rate during training.

  • decay_steps (int32) – A Python int32 number.

  • end_learning_rate (float) – A Python float number.

  • power (float) – A Python float number.

  • cycle (bool) – If set true, decay the learning rate every decay_steps.

Returns

The decayed learning rate

Return type

Variable

Examples

import paddle.fluid as fluid
start_lr = 0.01
total_step = 5000
end_lr = 0
lr = fluid.layers.polynomial_decay(
    start_lr, total_step, end_lr, power=1)