This is the below code what I am trying to implement
def scheduler(epoch):
init_lr=0.1
#after every third epoch I am changing the learning rate
if (epoch+1)%3==0:
changed_lr=init_lr*(1-0.05)**epoch
return changed_lr
#I tried this to change the learning rate based on accuracy of previous epoch
#if the present epoch accuracy is less than previous epoch's accuracy
else:
changed_lr=init_lr-(0.1)*init_lr
return changed_lr