Skip to main content

trials

Creates, updates, deletes, gets or lists a trials resource.

Overview

Nametrials
TypeResource
Idgoogle.aiplatform.trials

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
idstringOutput only. The identifier of the Trial assigned by the service.
namestringOutput only. Resource name of the Trial assigned by the service.
clientIdstringOutput only. The identifier of the client that originally requested this Trial. Each client is identified by a unique client_id. When a client asks for a suggestion, Vertex AI Vizier will assign it a Trial. The client should evaluate the Trial, complete it, and report back to Vertex AI Vizier. If suggestion is asked again by same client_id before the Trial is completed, the same Trial will be returned. Multiple clients with different client_ids can ask for suggestions simultaneously, each of them will get their own Trial.
customJobstringOutput only. The CustomJob name linked to the Trial. It's set for a HyperparameterTuningJob's Trial.
endTimestring (google-datetime)Output only. Time when the Trial's status changed to SUCCEEDED or INFEASIBLE.
finalMeasurementobjectOutput only. The final measurement containing the objective value. (id: GoogleCloudAiplatformV1Measurement)
infeasibleReasonstringOutput only. A human readable string describing why the Trial is infeasible. This is set only if Trial state is INFEASIBLE.
measurementsarrayOutput only. A list of measurements that are strictly lexicographically ordered by their induced tuples (steps, elapsed_duration). These are used for early stopping computations.
parametersarrayOutput only. The parameters of the Trial.
startTimestring (google-datetime)Output only. Time when the Trial was started.
statestringOutput only. The detailed state of the Trial.
webAccessUrisobjectOutput only. URIs for accessing interactive shells (one URI for each training node). Only available if this trial is part of a HyperparameterTuningJob and the job's trial_job_spec.enable_web_access field is true. The keys are names of each node used for the trial; for example, workerpool0-0 for the primary node, workerpool1-0 for the first node in the second worker pool, and workerpool1-1 for the second node in the second worker pool. The values are the URIs for each node's interactive shell.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectprojectsId, locationsId, studiesId, trialsIdGets a Trial.
listselectprojectsId, locationsId, studiesIdpageToken, pageSizeLists the Trials associated with a Study.
createinsertprojectsId, locationsId, studiesIdAdds a user provided Trial to a Study.
deletedeleteprojectsId, locationsId, studiesId, trialsIdDeletes a Trial.
suggestexecprojectsId, locationsId, studiesIdAdds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.
add_trial_measurementexecprojectsId, locationsId, studiesId, trialsIdAdds a measurement of the objective metrics to a Trial. This measurement is assumed to have been taken before the Trial is complete.
completeexecprojectsId, locationsId, studiesId, trialsIdMarks a Trial as complete.
check_trial_early_stopping_stateexecprojectsId, locationsId, studiesId, trialsIdChecks whether a Trial should stop or not. Returns a long-running operation. When the operation is successful, it will contain a CheckTrialEarlyStoppingStateResponse.
stopexecprojectsId, locationsId, studiesId, trialsIdStops a Trial.

Parameters

Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.

NameDatatypeDescription
locationsIdstring
projectsIdstring
studiesIdstring
trialsIdstring
pageSizeinteger (int32)
pageTokenstring

SELECT examples

Gets a Trial.

SELECT
id,
name,
clientId,
customJob,
endTime,
finalMeasurement,
infeasibleReason,
measurements,
parameters,
startTime,
state,
webAccessUris
FROM google.aiplatform.trials
WHERE projectsId = '{{ projectsId }}' -- required
AND locationsId = '{{ locationsId }}' -- required
AND studiesId = '{{ studiesId }}' -- required
AND trialsId = '{{ trialsId }}' -- required;

INSERT examples

Adds a user provided Trial to a Study.

INSERT INTO google.aiplatform.trials (
projectsId,
locationsId,
studiesId
)
SELECT
'{{ projectsId }}',
'{{ locationsId }}',
'{{ studiesId }}'
RETURNING
id,
name,
clientId,
customJob,
endTime,
finalMeasurement,
infeasibleReason,
measurements,
parameters,
startTime,
state,
webAccessUris
;

DELETE examples

Deletes a Trial.

DELETE FROM google.aiplatform.trials
WHERE projectsId = '{{ projectsId }}' --required
AND locationsId = '{{ locationsId }}' --required
AND studiesId = '{{ studiesId }}' --required
AND trialsId = '{{ trialsId }}' --required;

Lifecycle Methods

Adds one or more Trials to a Study, with parameter values suggested by Vertex AI Vizier. Returns a long-running operation associated with the generation of Trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.

EXEC google.aiplatform.trials.suggest 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@studiesId='{{ studiesId }}' --required
@@json=
'{
"suggestionCount": {{ suggestionCount }},
"clientId": "{{ clientId }}",
"contexts": "{{ contexts }}"
}';