async def sample_delete_trial(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.DeleteTrialRequest(name="name_value", ) # Make the request await client.delete_trial(request=request)
async def sample_stop_trial(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.StopTrialRequest(name="name_value", ) # Make the request response = await client.stop_trial(request=request) # Handle the response print(response)
async def sample_list_optimal_trials(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListOptimalTrialsRequest(parent="parent_value", ) # Make the request response = await client.list_optimal_trials(request=request) # Handle the response print(response)
async def sample_get_study(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.GetStudyRequest(name="name_value", ) # Make the request response = await client.get_study(request=request) # Handle the response print(response)
async def sample_create_trial(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CreateTrialRequest(parent="parent_value", ) # Make the request response = await client.create_trial(request=request) # Handle the response print(response)
async def sample_add_trial_measurement(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.AddTrialMeasurementRequest( trial_name="trial_name_value", ) # Make the request response = await client.add_trial_measurement(request=request) # Handle the response print(response)
async def sample_list_studies(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.ListStudiesRequest(parent="parent_value", ) # Make the request page_result = client.list_studies(request=request) # Handle the response async for response in page_result: print(response)
async def sample_lookup_study(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.LookupStudyRequest( parent="parent_value", display_name="display_name_value", ) # Make the request response = await client.lookup_study(request=request) # Handle the response print(response)
async def sample_check_trial_early_stopping_state(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.CheckTrialEarlyStoppingStateRequest( trial_name="trial_name_value", ) # Make the request operation = client.check_trial_early_stopping_state(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_suggest_trials(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) request = aiplatform_v1.SuggestTrialsRequest( parent="parent_value", suggestion_count=1744, client_id="client_id_value", ) # Make the request operation = client.suggest_trials(request=request) print("Waiting for operation to complete...") response = await operation.result() # Handle the response print(response)
async def sample_create_study(): # Create a client client = aiplatform_v1.VizierServiceAsyncClient() # Initialize request argument(s) study = aiplatform_v1.Study() study.display_name = "display_name_value" study.study_spec.metrics.metric_id = "metric_id_value" study.study_spec.metrics.goal = "MINIMIZE" study.study_spec.parameters.double_value_spec.min_value = 0.96 study.study_spec.parameters.double_value_spec.max_value = 0.962 study.study_spec.parameters.parameter_id = "parameter_id_value" request = aiplatform_v1.CreateStudyRequest( parent="parent_value", study=study, ) # Make the request response = await client.create_study(request=request) # Handle the response print(response)