import tensorflow as tf

            second_comp = learning_rate
        elif mode == 'sin':
            first_factor = (learning_rate - max_lr) / 2.
            second_factor = tf.sin((pi * global_step) / step_size)
            second_comp = (learning_rate + max_lr) / 2.
        elif mode == 'saw':
            first_factor = max_lr - learning_rate
            second_factor = tf.mod(global_step / step_size, 1)
            second_comp = learning_rate
        return first_factor * second_factor + second_comp
