Image creation – Vertex AI Custom Model Hyperparameter and Deployment-2
Step 5: Hyperparameter tuning
The next step is for hyperparameters. Follow the corresponding steps to enable and configure the hyperparameter tuning for model training, as shown in the Figure 5.15:
Figure 5.15: Configuring hyperparameter tuning
Follow the corresponding points:
- After Training container selection, an optional setting can be configured in Hyperparameters.
- Select the Enable hyperparameter tuning option.
- Provide the Parameter name (need to add the 5 parameters which we have included in the code, individually).
- Select the Type of the input provided for the hyperparameter. The type of hyperparameters it supports are categorical, discrete, double and integer. Select integer for the n_estimator.
- Provide the Value, as shown in the Figure 5.15 (this option changes as per the type.)
- Select No scaling option. (It supports linear, log and reverse log scaling).
- Click on Done. (One of the five hyperparameter are added.)
- Click on Add new parameter to add the details of the other parameters.
Refer to Table 5.1 and add the details of remaining four parameters:
Parameter name | Type | Value | Scaling |
max_depth | Discrete | 5,10,15,20 | No scaling |
min_samples_split | Discrete | 5,10 | No scaling |
min_samples_leaf | Discrete | 5,10 | No scaling |
max_features | Categorical | auto, sqrt | N/A |
Table 5.1: Hyperparameter list
If needed, change the type of max_depth, min_samples_split and min_samples_leaf to integer for seeing other options. Refer to Figure 5.16:
Figure 5.16: Configuring other parameters for hyperparameter tuning
Refer to the corresponding steps to complete the configuration of the hyperparameter:
- All the parameters that are added, will be listed.
- In the code we are optimizing accuracy metrics (to maximize), provide accuracy as the input.
- The Goal is to maximize the accuracy.
- Maximum number of trails is kept as low as 2, since the model is very simple.
- Maximum number of parallel trails is kept to 1 for the same reason.
- Under Algorithm, choose Default (random search or grid search can also be chosen). Explanations of different algorithms are listed below
• Random search: A straightforward random search of the realizable region.
• Unspecified algorithm: Not specifying an algorithm. Vertex AI picks between Gaussian process bandits, linear combination search, or its versions.
• Grid search: A viable grid search. This is important if users wish to specify more trials than viable points. If no grid search is specified, Vertex AI may create duplicate options. - Click on CONTINUE.
Note: GCP has restricted training CPUs for the free accounts. Try to keep the maximum trails and parallel trails low. If you get error such as quota metrics exceeded, try reducing the value of these two parameters.
Step 6: Compute and pricing
The next step is to provide compute and pricing details. Refer to Figure 5.17:
Figure 5.17: Compute and pricing for custom model
Follow the corresponding steps to select the machine type for training:
- Select Compute and pricing.
- Select the Region where the model training is to happen.
- Select the Machine type for the model training (choose the machine type based on how complicated your model training is).
- Acceleration type is optional and can be chosen for complex model trainings.
- Click START TRAINING, to finally start the same.
You may also like
Archives
- September 2024
- August 2024
- July 2024
- June 2024
- May 2024
- April 2024
- March 2024
- February 2024
- January 2024
- December 2023
- November 2023
- September 2023
- August 2023
- June 2023
- May 2023
- April 2023
- February 2023
- January 2023
- November 2022
- October 2022
- September 2022
- August 2022
- June 2022
- April 2022
- March 2022
- February 2022
- January 2022
- December 2021
- November 2021
- October 2021
Calendar
M | T | W | T | F | S | S |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Leave a Reply