Skip to content

Perform Hyperparameter tuning on a small Regression problem using TensorFlow 2

Notifications You must be signed in to change notification settings

imransalam/gcp-ai-platform-hyperparameter-tuning-tf2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gcp-ai-platform-hyperparameter-tuning-tf2

Perform Hyperparameter tuning on a small Regression problem using TensorFlow 2

Run with Docker image on Vertex AI

  • Setup environment variables
export REGION=us-central1
export PROJECT_ID=$(gcloud config list project --format "value(core.project)")
export IMAGE_REPO_NAME=gcp-vertex-ai-hyperparameter-tuning-tf
export IMAGE_NAME=gcp-vertex-ai-hyperparameter-tuning-tf
export IMAGE_TAG=latest
export IMAGE_URI=$REGION-docker.pkg.dev/$PROJECT_ID/$IMAGE_REPO_NAME/$IMAGE_NAME:$IMAGE_TAG
gcloud auth configure-docker $REGION-docker.pkg.dev
  • Build Docker image
docker build -f Dockerfile -t $IMAGE_URI ./
  • Push the Docker image to GCP artifacts registry
docker push $IMAGE_URI
  • Prepare hyperparameter tuning config file

In the hptuning_config.yaml you add the parameters to optimize with your hyperparameter tuning and provide arguments to your code as hyperparameters that will be used to optimize. You can also specify the job submission details like parallel jobs to run and how many jobs to run.

  • Training with hyperparameter tuning on the Vertex AI platform from Docker image

Initialize input variables

export JOB_NAME=hyperparameter_tuning_example

Submit the jobs


gcloud ai hp-tuning-jobs create --region $REGION --config hptuning_config.yaml --project=$PROJECT_ID --display-name=$JOB_NAME

About

Perform Hyperparameter tuning on a small Regression problem using TensorFlow 2

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published