Vertex AI Hyperparameter Tuning with Conditional Logic
You developed a Python module by using Keras to train a regression model. You developed two model architectures, linear regression and deep neural network (DNN), within the same module. You are using the training_method argument to select one of the two methods, and you are using the learning_rate and num_hidden_layers arguments in the DNN. You plan to use Vertex AI's hypertuning service with a budget to perform 100 trials. You want to identify the model architecture and hyperparameter values that minimize training loss and maximize model performance. What should you do?
Community Votes
67% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Community Insight
This question tests the ability to distinguish between shared and architecture-specific hyperparameters, specifically checking if you know that
learning_rateapplies to linear regression models trained via gradient descent, not just DNNs.
To efficiently identify the best model architecture and hyperparameters in Vertex AI, use a single hypertuning job with conditional hyperparameters. The community consensus confirms that num_hidden_layers must be conditional on the training method, while learning_rate is a shared parameter applicable to both linear regression and DNN models.
The most common error is selecting Option D, driven by the misconception that `learning_rate` is exclusive to Deep Neural Networks, whereas in Keras, linear regression models also utilize gradient descent optimizers requiring this parameter.
Community Discussion (9 comments)
Comments & Corrections
No comments yet — spotted an error or have a note? Share it below.
Expert Analysis
Why the Answer Is Correct
Option A is correct because it maximizes the 100-trial budget by running a single job that efficiently explores both architectures. It correctly configuresnum_hidden_layers as a conditional hyperparameter since this parameter is irrelevant for linear regression. Furthermore, it correctly identifies learning_rate as a non-conditional parameter because both the linear regression and DNN models, when implemented in Keras, rely on gradient-based optimizers that require a learning rate.Why the Other Options Are Wrong
Option D is incorrect because it unnecessarily restrictslearning_rate by making it conditional, implying it does not apply to linear regression, which is false in a Keras context. Options B and C are inefficient strategies; splitting the budget into separate jobs or running sequential sequential jobs reduces the effectiveness of the search compared to a unified tuning job that handles architecture selection via hyperparameters.Community Comment Notes
Community members strongly support Option A, citing thatlearning_rate is intelligently ignored or shared depending on the context, but explicitly required for both model types in a gradient descent setup. One user linked to official Google Cloud documentation on conditional hyperparameters to validate that only architecture-specific parameters need conditional logic. There was some debate regarding whether linear regression uses a learning rate, but the consensus is that the phrase "within the same module" implies a shared gradient-based training loop. Official Reference
Exam Strategy
When analyzing hyperparameter tuning scenarios, determine which parameters are global (like learning rate for gradient descent) versus those specific to certain model types (like hidden layers). Always prefer a single tuning job with conditional logic over multiple jobs to ensure the most efficient use of the trial budget.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →