Last active
September 25, 2020 18:21
-
-
Save edumunozsala/b20e847706cd13932d092f0cfbfe569f to your computer and use it in GitHub Desktop.
Callback where logs are recorded
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# start an Azure ML run | |
run = Run.get_context() | |
class LogRunMetrics(Callback): | |
# callback at the end of every epoch | |
def on_epoch_end(self, epoch, log): | |
# log a value repeated which creates a list | |
run.log('Loss', log['loss']) | |
run.log('Accuracy', log['acc']) | |
run.log('Val_Loss', log['val_loss']) | |
run.log('Val_Accuracy', log['val_acc']) | |
# Reduce LR | |
ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=5, verbose=0, cooldown=2, min_lr=0.0001) | |
run.log('LearningRate',self.model.optimizer.lr) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment