Log metrics

PHOTO EMBED

Sat Apr 09 2022 14:26:47 GMT+0000 (Coordinated Universal Time)

Saved by @wessim

from azureml.core.run import Run
run_logger = Run.get_context()
run_logger.log("accuracy", float(val_accuracy))
content_copyCOPY

The training script for your model must log the primary metric during model training so that HyperDrive can access it for hyperparameter tuning. The training script calculates the val_accuracy and logs it as the primary metric "accuracy". Each time the metric is logged, it's received by the hyperparameter tuning service. It's up to you to determine the frequency of reporting.

https://docs.microsoft.com/en-us/azure/machine-learning/how-to-tune-hyperparameters