Hi all,
I am wondering if there is a way to set the learning rate each epoch to a custom value.
for instance in Matconvent you can specify learning rate as  LR_SCHEDULE = np.logspace(-3, -5, 120)  to have it change from .001 to .00001 over 120 training epochs, for instance.
is there something similar I can do in Pytorch?
my first idea is to define the following function and then re-define the optimizer each epoch
def scheduler(optimizer,lr):
    for param_group in optimizer.param_groups:
        param_group['lr'] = lr
    return optimizer

so then
for epoch in range(EPOCHS):
        lr = LR_SCHEDULE[epoch]
        optimizer = scheduler(optimizer,lr)

could this work?
thanks