Is there any function like tf.train.piecewise_constant in PyTorch?
From tensorflow documents:
Example: use a learning rate that’s 1.0 for the first 100001 steps, 0.5 for the next 10000 steps, and 0.1 for any additional steps.
global_step = tf.Variable(0, trainable=False)
boundaries = [100000, 110000]
values = [1.0, 0.5, 0.1]
learning_rate = tf.train.piecewise_constant(global_step, boundaries, values)