Vertex AI Hyperparameter Tuning with Conditional Logic
Short answer
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.
Question
Key Takeaways
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.
Common mistake: 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.
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 configures num_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 restricts learning_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 that learning_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
This link opens the official vendor documentation in a new tab.
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.
Community Votes
67% of anonymous learners picked answer A. Votes are pick records left by other test-takers — they are not the verified answer.
Discussion 9 contributions
Compiled from public community threads and reader submissions, lightly edited for clarity. Handles and vote tallies are shown as recorded, and comments reflect the views of individual contributors.
From public community threads 9
-
lunalongo 👍 3A is the best option because: Running one single job with conditional logics added to hyperparameters settings avoids unnecessary computing usage and comparison efforts. Only num_hidden_layers needs to be set as a conditional hyperparameter under training_method; no explicit conditional logic is needed for learning_rate -- the latter is intelligently ignored by Vertex AI when linear regression is the training_method. B, C and D are less suitable because B and C run 2 separate jobs; D runs only one job, but it's hyperparameter tuning strategy adds redundant processing, even if it's true that the learning_rate is irrelevant for linear regression methods. The underlying logics behind it: As a STRUCTURAL hyperparameter, num_hidden_layers is intrinsically tied to the DNN's architecture definition. As a TRAINING hyperparameter, learning_rate is linked to the training process, not directly tied to the architecture definition.
-
carolctech 👍 3 Answered AThe best approach is A and here's why: The use of the 100 trials in a single job by using conditional hyperparameters maximizes budget efficiency. The number of hidden layers should be conditional, because it is relevant only for NON-LINEAR models like neural networks (which is DNN's case) and not for linear models -- where hidden layers don't exist. Learning rate is relevant for both models, unless the question stated that the regression model used a closed-form solution, not a gradient-based optimization method.
-
rajshiv 👍 2 Answered DA is incorrect because both num_hidden_layers and learning_rate are hyperparameters specific to the DNN model. Since both hyperparameters need to be conditional on training_method being DNN, making only one of them conditional is not sufficient. The problem has two model architectures: linear regression and DNN. Depending on the model architecture, the hyperparameters change: 1) For DNN, the hyperparameters are num_hidden_layers and learning_rate while 2) For linear regression, these hyperparameters are not relevant. Hence I vote D.
-
Omi_04040 👍 2 Answered AAnswer is A since 'learning rate' cannot be shared This question is a literal spinoff from this paragraph https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview#conditional_hyperparameters
-
Pau1234 👍 2 Answered AAgree with Omi_04040. num_hidden_layers is only relevant to the DNN model and not the linear regression model, according to the documentation
Show 4 more comments
-
River3000 👍 1This should be D, as the question stated that 'linear regression and deep neural network (DNN), within the same module', This typically means that even the linear regression model is trained using gradient-based optimization (such as SGD or Adam), rather than using a closed-form solution. So, the phrase "within the same module" implies that the linear model also relies on gradient descent, and thus the learning_rate parameter is applicable for training both models—even though the DNN additionally uses the num_hidden_layers parameter for its architecture.
-
Ankit267 👍 1 Answered AA & D for obvious reasons. Why A ? DNN with 1 num_hidden_layer is equivalent to linear regression model therefore num_hidden_layer is conditional, though learning_rate can be hyperparametrized for both DNN( one hidden layer i.e. linear regression & >1 hidden layer i.e. DNN). Therefore A is the right answer
-
JDpmle2024 👍 1 Answered DThis would allow you to first set the type of job, and only after that any other parameters. So first, select training_method. If training_method is DNN, then you specify the other parameters.
-
kaneup 👍 1 Answered Dthis is D
Reader comments & corrections
No reader corrections yet — spotted an error or have a note? Share it below.
Related Analysis
Practice All PMLE Questions
Access 65 questions with complete answers and detailed explanations.
View Full PMLE Practice Test →