parameters: (learning_rate, decay_steps, decay_rate, staircase=False)
docstring: Applies natural exponential decay to the initial learning rate.
  
      When training a model, it is often recommended to lower the learning rate as the
      training progresses. By using this function, the learning rate will be decayed by
      natural exponential power 'decay_rate' every 'decay_steps' steps.
  
      Decayed learning rate calculates as follows:
  
      >>> if not staircase:
      >>>     decayed_learning_rate = learning_rate * exp(- decay_rate * (global_step / decay_steps))
      >>> else:
      >>>     decayed_learning_rate = learning_rate * exp(- decay_rate * floor(global_step / decay_steps))
  
      Args:
          learning_rate(Variable|float): The initial learning rate. It should be a Variable 
                                         or a float
          decay_steps(int): The learning rate decay steps. See the decay computation above.
          decay_rate(float): The learning rate decay rate. See the decay computation above.
          staircase(bool): If True, decay the learning rate at discrete intervals, which 
                           means the learning rate will be decayed by natural exponential power
                           `decay_rate` every `decay_steps`. If False, learning rate will be
                           decayed continuously and following the formula above. Default: False
  
      Returns:
          The decayed learning rate. The data type is float32.
  
      Examples:
          .. code-block:: python
  
            import paddle.fluid as fluid
            import paddle
  
            paddle.enable_static()
            base_lr = 0.1
            sgd_optimizer = fluid.optimizer.SGD(
  	      learning_rate=fluid.layers.natural_exp_decay(
  		    learning_rate=base_lr,
  		    decay_steps=10000,
  		    decay_rate=0.5,
  		    staircase=True))
function: def natural_exp_decay(learning_rate, decay_steps, decay_rate, staircase=False):
      """
  
  Applies natural exponential decay to the initial learning rate.
  
      When training a model, it is often recommended to lower the learning rate as the
      training progresses. By using this function, the learning rate will be decayed by
      natural exponential power 'decay_rate' every 'decay_steps' steps.
  
      Decayed learning rate calculates as follows:
  
      >>> if not staircase:
      >>>     decayed_learning_rate = learning_rate * exp(- decay_rate * (global_step / decay_steps))
      >>> else:
      >>>     decayed_learning_rate = learning_rate * exp(- decay_rate * floor(global_step / decay_steps))
  
      Args:
          learning_rate(Variable|float): The initial learning rate. It should be a Variable 
                                         or a float
          decay_steps(int): The learning rate decay steps. See the decay computation above.
          decay_rate(float): The learning rate decay rate. See the decay computation above.
          staircase(bool): If True, decay the learning rate at discrete intervals, which 
                           means the learning rate will be decayed by natural exponential power
                           `decay_rate` every `decay_steps`. If False, learning rate will be
                           decayed continuously and following the formula above. Default: False
  
      Returns:
          The decayed learning rate. The data type is float32.
  
      Examples:
          .. code-block:: python
  
            import paddle.fluid as fluid
            import paddle
  
            paddle.enable_static()
            base_lr = 0.1
            sgd_optimizer = fluid.optimizer.SGD(
  	      learning_rate=fluid.layers.natural_exp_decay(
  		    learning_rate=base_lr,
  		    decay_steps=10000,
  		    decay_rate=0.5,
  		    staircase=True))
  
      """
      with default_main_program()._lr_schedule_guard():
          if in_dygraph_mode():
              decay = imperate_lr.NaturalExpDecay(learning_rate, decay_steps,
                                                  decay_rate, staircase)
              return decay
          else:
              global_step = _decay_step_counter()
  
              div_res = global_step / decay_steps
              if staircase:
                  div_res = ops.floor(div_res)
              decayed_lr = learning_rate * ops.exp(-1 * decay_rate * div_res)
  
              return decayed_lr
function_tokens: def natural_exp_decay ( learning_rate , decay_steps , decay_rate , staircase = False ) : with default_main_program ( ) . _lr_schedule_guard ( ) : if in_dygraph_mode ( ) : decay = imperate_lr . NaturalExpDecay ( learning_rate , decay_steps , decay_rate , staircase ) return decay else : global_step = _decay_step_counter ( ) div_res = global_step / decay_steps if staircase : div_res = ops . floor ( div_res ) decayed_lr = learning_rate * ops . exp ( - 1 * decay_rate * div_res ) return decayed_lr