Google Cloud Professional Machine Learning Engineer — Question 279

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?

Answer options

Correct answer: D

Explanation

Option D is the correct choice because it allows both num_hidden_layers and learning_rate to be adjusted based on the selected training_method, ensuring that the hyperparameters are relevant to the chosen model architecture. Option A incorrectly treats learning_rate as non-conditional, which may lead to suboptimal configurations. Option B unnecessarily splits the trials between two jobs, which limits the exploration of hyperparameters. Option C does not utilize the full budget effectively, as it only runs a single trial for the first stage before further tuning.