(self, optimizer, global_step, lr_value_range,
                     lr_step_range)
return updated_lr
Performs linear decay of the optimizer learning rate based on the number of global
        steps taken. Follows SNGAN's chainer implementation of linear decay, as seen in the
        chainer references:
        https://docs.chainer.org/en/stable/reference/generated/chainer.training.extensions.LinearShift.html
        https://github.com/chainer/chainer/blob/v6.2.0/chainer/training/extensions/linear_shift.py#L66

        Note: assumes that the optimizer has only one parameter group to update!

        Args:
            optimizer (Optimizer): Torch optimizer object to update learning rate.
            global_step (int): The current global step of the training.
            lr_value_range (tuple): A tuple of floats (x,y) to decrease from x to y.
            lr_step_range (tuple): A tuple of ints (i, j) to start decreasing
                when global_step > i, and until j.

        Returns:
            float: Float representing the new updated learning rate.
Performs linear decay of the optimizer learning rate based on the number of global
        steps taken. Follows SNGAN's chainer implementation of linear decay, as seen in the
        chainer references:
        https://docs.chainer.org/en/stable/reference/generated/chainer.training.extensions.LinearShift.html
        https://github.com/chainer/chainer/blob/v6.2.0/chainer/training/extensions/linear_shift.py#L66
Performs linear decay of the optimizer learning rate based on the number of global steps taken . Follows SNGAN s chainer implementation of linear decay as seen in the chainer references : https : // docs . chainer . org / en / stable / reference / generated / chainer . training . extensions . LinearShift . html https : // github . com / chainer / chainer / blob / v6 . 2 . 0 / chainer / training / extensions / linear_shift . py#L66
def linear_decay(self, optimizer, global_step, lr_value_range,
                     lr_step_range):
        """
        Performs linear decay of the optimizer learning rate based on the number of global
        steps taken. Follows SNGAN's chainer implementation of linear decay, as seen in the
        chainer references:
        https://docs.chainer.org/en/stable/reference/generated/chainer.training.extensions.LinearShift.html
        https://github.com/chainer/chainer/blob/v6.2.0/chainer/training/extensions/linear_shift.py#L66

        Note: assumes that the optimizer has only one parameter group to update!

        Args:
            optimizer (Optimizer): Torch optimizer object to update learning rate.
            global_step (int): The current global step of the training.
            lr_value_range (tuple): A tuple of floats (x,y) to decrease from x to y.
            lr_step_range (tuple): A tuple of ints (i, j) to start decreasing
                when global_step > i, and until j.

        Returns:
            float: Float representing the new updated learning rate.
        """
        # Compute the new learning rate
        v1, v2 = lr_value_range
        s1, s2 = lr_step_range

        if global_step <= s1:
            updated_lr = v1

        elif global_step >= s2:
            updated_lr = v2

        else:
            scale_factor = (global_step - s1) / (s2 - s1)
            updated_lr = v1 + scale_factor * (v2 - v1)

        # Update the learning rate
        optimizer.param_groups[0]['lr'] = updated_lr

        return updated_lr
def linear_decay ( self , optimizer , global_step , lr_value_range , lr_step_range ) : # Compute the new learning rate v1 , v2 = lr_value_range s1 , s2 = lr_step_range if global_step <= s1 : updated_lr = v1 elif global_step >= s2 : updated_lr = v2 else : scale_factor = ( global_step - s1 ) / ( s2 - s1 ) updated_lr = v1 + scale_factor * ( v2 - v1 ) # Update the learning rate optimizer . param_groups [ 0 ] [ 'lr' ] = updated_lr return updated_lr