
Answer-first summary for fast verification
Answer: Set the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to maximize., Set the primary_metric_name of the estimator used to run the bird_classifier_train.py script to accuracy., Add code to the bird_classifier_train.py script to calculate the validation accuracy of the model and log it as a float value with the key accuracy.
The question requires defining a primary metric for Hyperdrive to optimize hyperparameters for best accuracy in a multi-class image classification model. The correct actions are: A) Set primary_metric_goal to maximize, as accuracy should be maximized; D) Set primary_metric_name to 'accuracy', explicitly naming the metric; F) Add code to the training script to calculate validation accuracy and log it with key 'accuracy', ensuring Hyperdrive can track it. Option B is incorrect because logging loss doesn't align with optimizing accuracy; C is wrong as minimizing contradicts maximizing accuracy; E is unsuitable as 'loss' isn't the target metric. Community consensus (e.g., upvoted comments) and best practices confirm that for accuracy optimization, the goal must be maximize, the metric name must be accuracy, and the script must log accuracy.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You are creating a multi-class image classification deep learning model using the PyTorch framework and need to configure Hyperdrive to optimize hyperparameters for the best accuracy.
Which three actions must you perform to define a primary metric for determining the hyperparameter values that yield the model with the best accuracy score?
A
Set the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to maximize.
B
Add code to the bird_classifier_train.py script to calculate the validation loss of the model and log it as a float value with the key loss.
C
Set the primary_metric_goal of the estimator used to run the bird_classifier_train.py script to minimize.
D
Set the primary_metric_name of the estimator used to run the bird_classifier_train.py script to accuracy.
E
Set the primary_metric_name of the estimator used to run the bird_classifier_train.py script to loss.
F
Add code to the bird_classifier_train.py script to calculate the validation accuracy of the model and log it as a float value with the key accuracy.
No comments yet.