
Answer-first summary for fast verification
Answer: Run one hypertuning job for 100 trials. Set num_hidden_layers as a conditional hyperparameter based on its parent hyperparameter training_method, and set learning_rate as a non-conditional hyperparameter.
The correct answer is A because it efficiently uses the 100-trial budget in a single hypertuning job with appropriate conditional hyperparameters. num_hidden_layers should be conditional on training_method since it only applies to DNN architecture (linear regression has no hidden layers). learning_rate can be a non-conditional hyperparameter because both linear regression and DNN can use gradient-based optimization with learning rates when trained within the same Keras module. This approach avoids the inefficiency of running separate jobs (options B and C) and the redundancy of making learning_rate conditional (option D), as Vertex AI can intelligently handle hyperparameters that aren't relevant to certain configurations. The community discussion shows strong support for A with detailed reasoning about budget efficiency and hyperparameter relevance.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
No comments yet.
You have developed a Keras module for a regression model with two architectures: linear regression and a DNN. The training_method argument selects the architecture, while learning_rate and num_hidden_layers are used for the DNN. You plan to use Vertex AI hyperparameter tuning with a budget of 100 trials to find the architecture and hyperparameters that minimize training loss and maximize model performance. What should you do?
A
Run one hypertuning job for 100 trials. Set num_hidden_layers as a conditional hyperparameter based on its parent hyperparameter training_method, and set learning_rate as a non-conditional hyperparameter.
B
Run two separate hypertuning jobs, a linear regression job for 50 trials, and a DNN job for 50 trials. Compare their final performance on a common validation set, and select the set of hyperparameters with the least training loss.
C
Run one hypertuning job with training_method as the hyperparameter for 50 trials. Select the architecture with the lowest training loss, and further hypertune it and its corresponding hyperparameters tor 50 trials.
D
Run one hypertuning job for 100 trials. Set num_hidden_layers and learning_rate as conditional hyperparameters based on their parent hyperparameter training_method.