Compute
Elastic Cloud Server
Huawei Cloud Flexus
Bare Metal Server
Auto Scaling
Image Management Service
Dedicated Host
FunctionGraph
Cloud Phone Host
Huawei Cloud EulerOS
Networking
Virtual Private Cloud
Elastic IP
Elastic Load Balance
NAT Gateway
Direct Connect
Virtual Private Network
VPC Endpoint
Cloud Connect
Enterprise Router
Enterprise Switch
Global Accelerator
Management & Governance
Cloud Eye
Identity and Access Management
Cloud Trace Service
Resource Formation Service
Tag Management Service
Log Tank Service
Config
OneAccess
Resource Access Manager
Simple Message Notification
Application Performance Management
Application Operations Management
Organizations
Optimization Advisor
IAM Identity Center
Cloud Operations Center
Resource Governance Center
Migration
Server Migration Service
Object Storage Migration Service
Cloud Data Migration
Migration Center
Cloud Ecosystem
KooGallery
Partner Center
User Support
My Account
Billing Center
Cost Center
Resource Center
Enterprise Management
Service Tickets
HUAWEI CLOUD (International) FAQs
ICP Filing
Support Plans
My Credentials
Customer Operation Capabilities
Partner Support Plans
Professional Services
Analytics
MapReduce Service
Data Lake Insight
CloudTable Service
Cloud Search Service
Data Lake Visualization
Data Ingestion Service
GaussDB(DWS)
DataArts Studio
Data Lake Factory
DataArts Lake Formation
IoT
IoT Device Access
Others
Product Pricing Details
System Permissions
Console Quick Start
Common FAQs
Instructions for Associating with a HUAWEI CLOUD Partner
Message Center
Security & Compliance
Security Technologies and Applications
Web Application Firewall
Host Security Service
Cloud Firewall
SecMaster
Anti-DDoS Service
Data Encryption Workshop
Database Security Service
Cloud Bastion Host
Data Security Center
Cloud Certificate Manager
Edge Security
Situation Awareness
Managed Threat Detection
Blockchain
Blockchain Service
Web3 Node Engine Service
Media Services
Media Processing Center
Video On Demand
Live
SparkRTC
MetaStudio
Storage
Object Storage Service
Elastic Volume Service
Cloud Backup and Recovery
Storage Disaster Recovery Service
Scalable File Service Turbo
Scalable File Service
Volume Backup Service
Cloud Server Backup Service
Data Express Service
Dedicated Distributed Storage Service
Containers
Cloud Container Engine
SoftWare Repository for Container
Application Service Mesh
Ubiquitous Cloud Native Service
Cloud Container Instance
Databases
Relational Database Service
Document Database Service
Data Admin Service
Data Replication Service
GeminiDB
GaussDB
Distributed Database Middleware
Database and Application Migration UGO
TaurusDB
Middleware
Distributed Cache Service
API Gateway
Distributed Message Service for Kafka
Distributed Message Service for RabbitMQ
Distributed Message Service for RocketMQ
Cloud Service Engine
Multi-Site High Availability Service
EventGrid
Dedicated Cloud
Dedicated Computing Cluster
Business Applications
Workspace
ROMA Connect
Message & SMS
Domain Name Service
Edge Data Center Management
Meeting
AI
Face Recognition Service
Graph Engine Service
Content Moderation
Image Recognition
Optical Character Recognition
ModelArts
ImageSearch
Conversational Bot Service
Speech Interaction Service
Huawei HiLens
Video Intelligent Analysis Service
Developer Tools
SDK Developer Guide
API Request Signing Guide
Terraform
Koo Command Line Interface
Content Delivery & Edge Computing
Content Delivery Network
Intelligent EdgeFabric
CloudPond
Intelligent EdgeCloud
Solutions
SAP Cloud
High Performance Computing
Developer Services
ServiceStage
CodeArts
CodeArts PerfTest
CodeArts Req
CodeArts Pipeline
CodeArts Build
CodeArts Deploy
CodeArts Artifact
CodeArts TestPlan
CodeArts Check
CodeArts Repo
Cloud Application Engine
MacroVerse aPaaS
KooMessage
KooPhone
KooDrive

Creating a Hyperparameter Search Job

Updated on 2024-07-25 GMT+08:00

Background

If the AI engine is pytorch_1.8.0-cuda_10.2-py_3.7-ubuntu_18.04-x86_64 or tensorflow_2.1.0-cuda_10.1-py_3.7-ubuntu_18.04-x86_64 and the hyperparameter to be optimized is of the float type, you can use hyperparameter search on ModelArts.

You can perform the hyperparameter search without any code modification. The procedure is as follows:

  1. Preparations
  2. Creating an Algorithm
  3. Creating a Training Job
  4. Viewing Details About a Hyperparameter Search Job

Preparations

  • Data has been prepared. Specifically, you have created an available dataset in ModelArts, or you have uploaded the dataset used for training to the OBS directory.
  • Prepare the training script and upload it to the OBS directory. For details about how to develop a training script, see Developing a Custom Script.
  • In the training code, print the search indicator parameters.
  • At least one empty folder has been created in OBS for storing the training output.
  • The account is not in arrears because resources are consumed when training jobs are running.
  • The OBS directory you use and ModelArts are in the same region.

Creating an Algorithm

Log in to the ModelArts management console and create an algorithm by referring to Creating an Algorithm. The image must use the pytorch_1.8.0-cuda_10.2-py_3.7-ubuntu_18.04-x86_64 or tensorflow_2.1.0-cuda_10.1-py_3.7-ubuntu_18.04-x86_64 engine.

Hyperparameters that you want to optimize need to be defined when you configure Hyperparameters. You can specify the name, type, default value, and constraints. For details, see Defining Hyperparameters.

Select autoSearch(S) to enable auto search for the algorithm. During an auto search, ModelArts uses a regular expression to obtain the search indicator parameters and performs hyperparameter optimization based on the optimization direction. Print search parameters in the code and set the following parameters.

Figure 1 Enabling auto search
  • Search Indicator

    The search indicator is the value of the objective function, which can be loss, accuracy, and so on. By optimizing and converging this value based on the optimization direction, the optimal hyperparameter can be found to improve the model precision and convergence speed.

    Table 1 Search indicator parameters

    Parameter

    Description

    Name

    search indicator name. This parameter must be identical to the search indicator parameter in the code.

    Optimization Direction

    This parameter can be max or min.

    Counter regularization

    A regular expression needs to be entered. You can click Generate Intelligently to generate a regular expression automatically.

  • Setting Automatic Search Parameters

    Select hyperparameters that can be used for search optimization from what you configured for Hyperparameters. Only hyperparameters of the float type are supported. After autoSearch(S) is selected, set the value range.

  • Search Algorithm Configuration

    ModelArts has three built-in algorithms for hyperparameter search. You can select one or more algorithms as needed. The algorithms and their parameter description are as follows:

After the algorithm is created, use it to create a training job.

Creating a Training Job

Log in to the ModelArts console and create a training job by referring to Creating a Training Job. Pay attention to operations described in this section before you enable the hyperparameter search.

If you select an algorithm that supports hyperparameter search, click the button for range setting to enable hyperparameter search.

Figure 2 Enabling hyperparameter search

After the hyperparameter search is enabled, you can configure the search indicator, search algorithm, and parameters of the selected algorithm. These parameters need to have the same values as the hyperparameters of the algorithm you created.

After a hyperparameter search job is created, it will take a period of time to run it.

Viewing Details About a Hyperparameter Search Job

After a training job is completed, you can review the results of the automated hyperparameter search to evaluate the job's performance.

If the training job is a hyperparameter search job, go to the training job details page and click the Auto Search Results tab to view the hyperparameter search results.

Figure 3 Hyperparameter search results

We use cookies to improve our site and your experience. By continuing to browse our site you accept our cookie policy. Find out more

Feedback

Feedback

Feedback

0/500

Selected Content

Submit selected content with the feedback