I used LearningRateScheduler for my model training. I want to save learning rates on each epoch in CSV file (or other document files).
Is there any way to save those learning rates using callbacks?
Asked
Active
Viewed 518 times
1

AIFahim
- 273
- 1
- 3
- 15
1 Answers
4
You may write a Custom Callback and save the LR in a file.
You will get it by - self.model.optimizer.learning_rate
Custom Callback - Keras docs
class CustomCallback(keras.callbacks.Callback):
def on_epoch_end(self, epoch, logs=None):
print("LR - {}".format(self.model.optimizer.learning_rate))
my_callbacks = [ CustomCallback() ]
LR - <tf.Variable 'Adam/learning_rate:0' shape=() dtype=float32, numpy=0.001>

10xAI
- 5,584
- 2
- 8
- 24
-
Thanks a lot exactly what I need! – AIFahim Jan 23 '21 at 18:41
-
You may mark the Answer as accepted then. – 10xAI Jan 24 '21 at 01:05
-
Can you please tell me from where I find mark answer option . I am a newbie in this platform. – AIFahim Jan 24 '21 at 03:10
-
Got it I mark your answer. Thanks a lot for helping. If you find this question should useful in this community then upvote inspire me a lot. Thank you once again,. – AIFahim Jan 24 '21 at 03:14