Skip to main content

trials

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

Overview

Nametrials
TypeResource
Idgoogle.ml.trials

Fields

The following fields are returned by SELECT queries:

Successful response

NameDatatypeDescription
namestringOutput only. Name of the trial assigned by the service.
clientIdstringOutput only. The identifier of the client that originally requested this trial.
endTimestring (google-datetime)Output only. Time at which the trial's status changed to COMPLETED.
finalMeasurementobjectThe final measurement containing the objective value. (id: GoogleCloudMlV1__Measurement)
infeasibleReasonstringOutput only. A human readable string describing why the trial is infeasible. This should only be set if trial_infeasible is true.
measurementsarrayA list of measurements that are strictly lexicographically ordered by their induced tuples (steps, elapsed_time). These are used for early stopping computations.
parametersarrayThe parameters of the trial.
startTimestring (google-datetime)Output only. Time at which the trial was started.
statestringThe detailed state of a trial.
trialInfeasiblebooleanOutput only. If true, the parameters in this trial are not attempted again.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
projects_locations_studies_trials_getselectprojectsId, locationsId, studiesId, trialsIdGets a trial.
projects_locations_studies_trials_listselectprojectsId, locationsId, studiesIdLists the trials associated with a study.
projects_locations_studies_trials_createinsertprojectsId, locationsId, studiesIdAdds a user provided trial to a study.
projects_locations_studies_trials_deletedeleteprojectsId, locationsId, studiesId, trialsIdDeletes a trial.
projects_locations_studies_trials_suggestexecprojectsId, locationsId, studiesIdAdds one or more trials to a study, with parameter values suggested by AI Platform Vizier. Returns a long-running operation associated with the generation of trial suggestions. When this long-running operation succeeds, it will contain a SuggestTrialsResponse.
projects_locations_studies_trials_completeexecprojectsId, locationsId, studiesId, trialsIdMarks a trial as complete.
projects_locations_studies_trials_check_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.
projects_locations_studies_trials_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

SELECT examples

Gets a trial.

SELECT
name,
clientId,
endTime,
finalMeasurement,
infeasibleReason,
measurements,
parameters,
startTime,
state,
trialInfeasible
FROM google.ml.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.ml.trials (
data__state,
data__parameters,
data__finalMeasurement,
data__measurements,
projectsId,
locationsId,
studiesId
)
SELECT
'{{ state }}',
'{{ parameters }}',
'{{ finalMeasurement }}',
'{{ measurements }}',
'{{ projectsId }}',
'{{ locationsId }}',
'{{ studiesId }}'
RETURNING
name,
clientId,
endTime,
finalMeasurement,
infeasibleReason,
measurements,
parameters,
startTime,
state,
trialInfeasible
;

DELETE examples

Deletes a trial.

DELETE FROM google.ml.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 AI Platform 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.ml.trials.projects_locations_studies_trials_suggest 
@projectsId='{{ projectsId }}' --required,
@locationsId='{{ locationsId }}' --required,
@studiesId='{{ studiesId }}' --required
@@json=
'{
"suggestionCount": {{ suggestionCount }},
"clientId": "{{ clientId }}"
}';