xref: /aosp_15_r20/external/googleapis/google/cloud/aiplatform/v1/study.proto (revision d5c09012810ac0c9f33fe448fb6da8260d444cc9)
1// Copyright 2023 Google LLC
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7//     http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15syntax = "proto3";
16
17package google.cloud.aiplatform.v1;
18
19import "google/api/field_behavior.proto";
20import "google/api/resource.proto";
21import "google/protobuf/duration.proto";
22import "google/protobuf/struct.proto";
23import "google/protobuf/timestamp.proto";
24import "google/protobuf/wrappers.proto";
25
26option csharp_namespace = "Google.Cloud.AIPlatform.V1";
27option go_package = "cloud.google.com/go/aiplatform/apiv1/aiplatformpb;aiplatformpb";
28option java_multiple_files = true;
29option java_outer_classname = "StudyProto";
30option java_package = "com.google.cloud.aiplatform.v1";
31option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
32option ruby_package = "Google::Cloud::AIPlatform::V1";
33
34// A message representing a Study.
35message Study {
36  option (google.api.resource) = {
37    type: "aiplatform.googleapis.com/Study"
38    pattern: "projects/{project}/locations/{location}/studies/{study}"
39  };
40
41  // Describes the Study state.
42  enum State {
43    // The study state is unspecified.
44    STATE_UNSPECIFIED = 0;
45
46    // The study is active.
47    ACTIVE = 1;
48
49    // The study is stopped due to an internal error.
50    INACTIVE = 2;
51
52    // The study is done when the service exhausts the parameter search space
53    // or max_trial_count is reached.
54    COMPLETED = 3;
55  }
56
57  // Output only. The name of a study. The study's globally unique identifier.
58  // Format: `projects/{project}/locations/{location}/studies/{study}`
59  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
60
61  // Required. Describes the Study, default value is empty string.
62  string display_name = 2 [(google.api.field_behavior) = REQUIRED];
63
64  // Required. Configuration of the Study.
65  StudySpec study_spec = 3 [(google.api.field_behavior) = REQUIRED];
66
67  // Output only. The detailed state of a Study.
68  State state = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
69
70  // Output only. Time at which the study was created.
71  google.protobuf.Timestamp create_time = 5
72      [(google.api.field_behavior) = OUTPUT_ONLY];
73
74  // Output only. A human readable reason why the Study is inactive.
75  // This should be empty if a study is ACTIVE or COMPLETED.
76  string inactive_reason = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
77}
78
79// A message representing a Trial. A Trial contains a unique set of Parameters
80// that has been or will be evaluated, along with the objective metrics got by
81// running the Trial.
82message Trial {
83  option (google.api.resource) = {
84    type: "aiplatform.googleapis.com/Trial"
85    pattern: "projects/{project}/locations/{location}/studies/{study}/trials/{trial}"
86  };
87
88  // A message representing a parameter to be tuned.
89  message Parameter {
90    // Output only. The ID of the parameter. The parameter should be defined in
91    // [StudySpec's
92    // Parameters][google.cloud.aiplatform.v1.StudySpec.parameters].
93    string parameter_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
94
95    // Output only. The value of the parameter.
96    // `number_value` will be set if a parameter defined in StudySpec is
97    // in type 'INTEGER', 'DOUBLE' or 'DISCRETE'.
98    // `string_value` will be set if a parameter defined in StudySpec is
99    // in type 'CATEGORICAL'.
100    google.protobuf.Value value = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
101  }
102
103  // Describes a Trial state.
104  enum State {
105    // The Trial state is unspecified.
106    STATE_UNSPECIFIED = 0;
107
108    // Indicates that a specific Trial has been requested, but it has not yet
109    // been suggested by the service.
110    REQUESTED = 1;
111
112    // Indicates that the Trial has been suggested.
113    ACTIVE = 2;
114
115    // Indicates that the Trial should stop according to the service.
116    STOPPING = 3;
117
118    // Indicates that the Trial is completed successfully.
119    SUCCEEDED = 4;
120
121    // Indicates that the Trial should not be attempted again.
122    // The service will set a Trial to INFEASIBLE when it's done but missing
123    // the final_measurement.
124    INFEASIBLE = 5;
125  }
126
127  // Output only. Resource name of the Trial assigned by the service.
128  string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
129
130  // Output only. The identifier of the Trial assigned by the service.
131  string id = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
132
133  // Output only. The detailed state of the Trial.
134  State state = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
135
136  // Output only. The parameters of the Trial.
137  repeated Parameter parameters = 4 [(google.api.field_behavior) = OUTPUT_ONLY];
138
139  // Output only. The final measurement containing the objective value.
140  Measurement final_measurement = 5 [(google.api.field_behavior) = OUTPUT_ONLY];
141
142  // Output only. A list of measurements that are strictly lexicographically
143  // ordered by their induced tuples (steps, elapsed_duration).
144  // These are used for early stopping computations.
145  repeated Measurement measurements = 6
146      [(google.api.field_behavior) = OUTPUT_ONLY];
147
148  // Output only. Time when the Trial was started.
149  google.protobuf.Timestamp start_time = 7
150      [(google.api.field_behavior) = OUTPUT_ONLY];
151
152  // Output only. Time when the Trial's status changed to `SUCCEEDED` or
153  // `INFEASIBLE`.
154  google.protobuf.Timestamp end_time = 8
155      [(google.api.field_behavior) = OUTPUT_ONLY];
156
157  // Output only. The identifier of the client that originally requested this
158  // Trial. Each client is identified by a unique client_id. When a client asks
159  // for a suggestion, Vertex AI Vizier will assign it a Trial. The client
160  // should evaluate the Trial, complete it, and report back to Vertex AI
161  // Vizier. If suggestion is asked again by same client_id before the Trial is
162  // completed, the same Trial will be returned. Multiple clients with
163  // different client_ids can ask for suggestions simultaneously, each of them
164  // will get their own Trial.
165  string client_id = 9 [(google.api.field_behavior) = OUTPUT_ONLY];
166
167  // Output only. A human readable string describing why the Trial is
168  // infeasible. This is set only if Trial state is `INFEASIBLE`.
169  string infeasible_reason = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
170
171  // Output only. The CustomJob name linked to the Trial.
172  // It's set for a HyperparameterTuningJob's Trial.
173  string custom_job = 11 [
174    (google.api.field_behavior) = OUTPUT_ONLY,
175    (google.api.resource_reference) = {
176      type: "aiplatform.googleapis.com/CustomJob"
177    }
178  ];
179
180  // Output only. URIs for accessing [interactive
181  // shells](https://cloud.google.com/vertex-ai/docs/training/monitor-debug-interactive-shell)
182  // (one URI for each training node). Only available if this trial is part of
183  // a
184  // [HyperparameterTuningJob][google.cloud.aiplatform.v1.HyperparameterTuningJob]
185  // and the job's
186  // [trial_job_spec.enable_web_access][google.cloud.aiplatform.v1.CustomJobSpec.enable_web_access]
187  // field is `true`.
188  //
189  // The keys are names of each node used for the trial; for example,
190  // `workerpool0-0` for the primary node, `workerpool1-0` for the first node in
191  // the second worker pool, and `workerpool1-1` for the second node in the
192  // second worker pool.
193  //
194  // The values are the URIs for each node's interactive shell.
195  map<string, string> web_access_uris = 12
196      [(google.api.field_behavior) = OUTPUT_ONLY];
197}
198
199// Next ID: 3
200message TrialContext {
201  // A human-readable field which can store a description of this context.
202  // This will become part of the resulting Trial's description field.
203  string description = 1;
204
205  // If/when a Trial is generated or selected from this Context,
206  // its Parameters will match any parameters specified here.
207  // (I.e. if this context specifies parameter name:'a' int_value:3,
208  // then a resulting Trial will have int_value:3 for its parameter named
209  // 'a'.) Note that we first attempt to match existing REQUESTED Trials with
210  // contexts, and if there are no matches, we generate suggestions in the
211  // subspace defined by the parameters specified here.
212  // NOTE: a Context without any Parameters matches the entire feasible search
213  //   space.
214  repeated Trial.Parameter parameters = 2;
215}
216
217// Time-based Constraint for Study
218message StudyTimeConstraint {
219  oneof constraint {
220    // Counts the wallclock time passed since the creation of this Study.
221    google.protobuf.Duration max_duration = 1;
222
223    // Compares the wallclock time to this time. Must use UTC timezone.
224    google.protobuf.Timestamp end_time = 2;
225  }
226}
227
228// Represents specification of a Study.
229message StudySpec {
230  // Represents a metric to optimize.
231  message MetricSpec {
232    // Used in safe optimization to specify threshold levels and risk tolerance.
233    message SafetyMetricConfig {
234      // Safety threshold (boundary value between safe and unsafe). NOTE that if
235      // you leave SafetyMetricConfig unset, a default value of 0 will be used.
236      double safety_threshold = 1;
237
238      // Desired minimum fraction of safe trials (over total number of trials)
239      // that should be targeted by the algorithm at any time during the
240      // study (best effort). This should be between 0.0 and 1.0 and a value of
241      // 0.0 means that there is no minimum and an algorithm proceeds without
242      // targeting any specific fraction. A value of 1.0 means that the
243      // algorithm attempts to only Suggest safe Trials.
244      optional double desired_min_safe_trials_fraction = 2;
245    }
246
247    // The available types of optimization goals.
248    enum GoalType {
249      // Goal Type will default to maximize.
250      GOAL_TYPE_UNSPECIFIED = 0;
251
252      // Maximize the goal metric.
253      MAXIMIZE = 1;
254
255      // Minimize the goal metric.
256      MINIMIZE = 2;
257    }
258
259    // Required. The ID of the metric. Must not contain whitespaces and must be
260    // unique amongst all MetricSpecs.
261    string metric_id = 1 [(google.api.field_behavior) = REQUIRED];
262
263    // Required. The optimization goal of the metric.
264    GoalType goal = 2 [(google.api.field_behavior) = REQUIRED];
265
266    // Used for safe search. In the case, the metric will be a safety
267    // metric. You must provide a separate metric for objective metric.
268    optional SafetyMetricConfig safety_config = 3;
269  }
270
271  // Represents a single parameter to optimize.
272  message ParameterSpec {
273    // Value specification for a parameter in `DOUBLE` type.
274    message DoubleValueSpec {
275      // Required. Inclusive minimum value of the parameter.
276      double min_value = 1 [(google.api.field_behavior) = REQUIRED];
277
278      // Required. Inclusive maximum value of the parameter.
279      double max_value = 2 [(google.api.field_behavior) = REQUIRED];
280
281      // A default value for a `DOUBLE` parameter that is assumed to be a
282      // relatively good starting point.  Unset value signals that there is no
283      // offered starting point.
284      //
285      // Currently only supported by the Vertex AI Vizier service. Not supported
286      // by HyperparameterTuningJob or TrainingPipeline.
287      optional double default_value = 4;
288    }
289
290    // Value specification for a parameter in `INTEGER` type.
291    message IntegerValueSpec {
292      // Required. Inclusive minimum value of the parameter.
293      int64 min_value = 1 [(google.api.field_behavior) = REQUIRED];
294
295      // Required. Inclusive maximum value of the parameter.
296      int64 max_value = 2 [(google.api.field_behavior) = REQUIRED];
297
298      // A default value for an `INTEGER` parameter that is assumed to be a
299      // relatively good starting point.  Unset value signals that there is no
300      // offered starting point.
301      //
302      // Currently only supported by the Vertex AI Vizier service. Not supported
303      // by HyperparameterTuningJob or TrainingPipeline.
304      optional int64 default_value = 4;
305    }
306
307    // Value specification for a parameter in `CATEGORICAL` type.
308    message CategoricalValueSpec {
309      // Required. The list of possible categories.
310      repeated string values = 1 [(google.api.field_behavior) = REQUIRED];
311
312      // A default value for a `CATEGORICAL` parameter that is assumed to be a
313      // relatively good starting point.  Unset value signals that there is no
314      // offered starting point.
315      //
316      // Currently only supported by the Vertex AI Vizier service. Not supported
317      // by HyperparameterTuningJob or TrainingPipeline.
318      optional string default_value = 3;
319    }
320
321    // Value specification for a parameter in `DISCRETE` type.
322    message DiscreteValueSpec {
323      // Required. A list of possible values.
324      // The list should be in increasing order and at least 1e-10 apart.
325      // For instance, this parameter might have possible settings of 1.5, 2.5,
326      // and 4.0. This list should not contain more than 1,000 values.
327      repeated double values = 1 [(google.api.field_behavior) = REQUIRED];
328
329      // A default value for a `DISCRETE` parameter that is assumed to be a
330      // relatively good starting point.  Unset value signals that there is no
331      // offered starting point.  It automatically rounds to the
332      // nearest feasible discrete point.
333      //
334      // Currently only supported by the Vertex AI Vizier service. Not supported
335      // by HyperparameterTuningJob or TrainingPipeline.
336      optional double default_value = 3;
337    }
338
339    // Represents a parameter spec with condition from its parent parameter.
340    message ConditionalParameterSpec {
341      // Represents the spec to match discrete values from parent parameter.
342      message DiscreteValueCondition {
343        // Required. Matches values of the parent parameter of 'DISCRETE' type.
344        // All values must exist in `discrete_value_spec` of parent parameter.
345        //
346        // The Epsilon of the value matching is 1e-10.
347        repeated double values = 1 [(google.api.field_behavior) = REQUIRED];
348      }
349
350      // Represents the spec to match integer values from parent parameter.
351      message IntValueCondition {
352        // Required. Matches values of the parent parameter of 'INTEGER' type.
353        // All values must lie in `integer_value_spec` of parent parameter.
354        repeated int64 values = 1 [(google.api.field_behavior) = REQUIRED];
355      }
356
357      // Represents the spec to match categorical values from parent parameter.
358      message CategoricalValueCondition {
359        // Required. Matches values of the parent parameter of 'CATEGORICAL'
360        // type. All values must exist in `categorical_value_spec` of parent
361        // parameter.
362        repeated string values = 1 [(google.api.field_behavior) = REQUIRED];
363      }
364
365      // A set of parameter values from the parent ParameterSpec's feasible
366      // space.
367      oneof parent_value_condition {
368        // The spec for matching values from a parent parameter of
369        // `DISCRETE` type.
370        DiscreteValueCondition parent_discrete_values = 2;
371
372        // The spec for matching values from a parent parameter of `INTEGER`
373        // type.
374        IntValueCondition parent_int_values = 3;
375
376        // The spec for matching values from a parent parameter of
377        // `CATEGORICAL` type.
378        CategoricalValueCondition parent_categorical_values = 4;
379      }
380
381      // Required. The spec for a conditional parameter.
382      ParameterSpec parameter_spec = 1 [(google.api.field_behavior) = REQUIRED];
383    }
384
385    // The type of scaling that should be applied to this parameter.
386    enum ScaleType {
387      // By default, no scaling is applied.
388      SCALE_TYPE_UNSPECIFIED = 0;
389
390      // Scales the feasible space to (0, 1) linearly.
391      UNIT_LINEAR_SCALE = 1;
392
393      // Scales the feasible space logarithmically to (0, 1). The entire
394      // feasible space must be strictly positive.
395      UNIT_LOG_SCALE = 2;
396
397      // Scales the feasible space "reverse" logarithmically to (0, 1). The
398      // result is that values close to the top of the feasible space are spread
399      // out more than points near the bottom. The entire feasible space must be
400      // strictly positive.
401      UNIT_REVERSE_LOG_SCALE = 3;
402    }
403
404    oneof parameter_value_spec {
405      // The value spec for a 'DOUBLE' parameter.
406      DoubleValueSpec double_value_spec = 2;
407
408      // The value spec for an 'INTEGER' parameter.
409      IntegerValueSpec integer_value_spec = 3;
410
411      // The value spec for a 'CATEGORICAL' parameter.
412      CategoricalValueSpec categorical_value_spec = 4;
413
414      // The value spec for a 'DISCRETE' parameter.
415      DiscreteValueSpec discrete_value_spec = 5;
416    }
417
418    // Required. The ID of the parameter. Must not contain whitespaces and must
419    // be unique amongst all ParameterSpecs.
420    string parameter_id = 1 [(google.api.field_behavior) = REQUIRED];
421
422    // How the parameter should be scaled.
423    // Leave unset for `CATEGORICAL` parameters.
424    ScaleType scale_type = 6;
425
426    // A conditional parameter node is active if the parameter's value matches
427    // the conditional node's parent_value_condition.
428    //
429    // If two items in conditional_parameter_specs have the same name, they
430    // must have disjoint parent_value_condition.
431    repeated ConditionalParameterSpec conditional_parameter_specs = 10;
432  }
433
434  // The decay curve automated stopping rule builds a Gaussian Process
435  // Regressor to predict the final objective value of a Trial based on the
436  // already completed Trials and the intermediate measurements of the current
437  // Trial. Early stopping is requested for the current Trial if there is very
438  // low probability to exceed the optimal value found so far.
439  message DecayCurveAutomatedStoppingSpec {
440    // True if
441    // [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration]
442    // is used as the x-axis of each Trials Decay Curve. Otherwise,
443    // [Measurement.step_count][google.cloud.aiplatform.v1.Measurement.step_count]
444    // will be used as the x-axis.
445    bool use_elapsed_duration = 1;
446  }
447
448  // The median automated stopping rule stops a pending Trial if the Trial's
449  // best objective_value is strictly below the median 'performance' of all
450  // completed Trials reported up to the Trial's last measurement.
451  // Currently, 'performance' refers to the running average of the objective
452  // values reported by the Trial in each measurement.
453  message MedianAutomatedStoppingSpec {
454    // True if median automated stopping rule applies on
455    // [Measurement.elapsed_duration][google.cloud.aiplatform.v1.Measurement.elapsed_duration].
456    // It means that elapsed_duration field of latest measurement of current
457    // Trial is used to compute median objective value for each completed
458    // Trials.
459    bool use_elapsed_duration = 1;
460  }
461
462  // Configuration for ConvexAutomatedStoppingSpec.
463  // When there are enough completed trials (configured by
464  // min_measurement_count), for pending trials with enough measurements and
465  // steps, the policy first computes an overestimate of the objective value at
466  // max_num_steps according to the slope of the incomplete objective value
467  // curve. No prediction can be made if the curve is completely flat. If the
468  // overestimation is worse than the best objective value of the completed
469  // trials, this pending trial will be early-stopped, but a last measurement
470  // will be added to the pending trial with max_num_steps and predicted
471  // objective value from the autoregression model.
472  message ConvexAutomatedStoppingSpec {
473    // Steps used in predicting the final objective for early stopped trials. In
474    // general, it's set to be the same as the defined steps in training /
475    // tuning. If not defined, it will learn it from the completed trials. When
476    // use_steps is false, this field is set to the maximum elapsed seconds.
477    int64 max_step_count = 1;
478
479    // Minimum number of steps for a trial to complete. Trials which do not have
480    // a measurement with step_count > min_step_count won't be considered for
481    // early stopping. It's ok to set it to 0, and a trial can be early stopped
482    // at any stage. By default, min_step_count is set to be one-tenth of the
483    // max_step_count.
484    // When use_elapsed_duration is true, this field is set to the minimum
485    // elapsed seconds.
486    int64 min_step_count = 2;
487
488    // The minimal number of measurements in a Trial.  Early-stopping checks
489    // will not trigger if less than min_measurement_count+1 completed trials or
490    // pending trials with less than min_measurement_count measurements. If not
491    // defined, the default value is 5.
492    int64 min_measurement_count = 3;
493
494    // The hyper-parameter name used in the tuning job that stands for learning
495    // rate. Leave it blank if learning rate is not in a parameter in tuning.
496    // The learning_rate is used to estimate the objective value of the ongoing
497    // trial.
498    string learning_rate_parameter_name = 4;
499
500    // This bool determines whether or not the rule is applied based on
501    // elapsed_secs or steps. If use_elapsed_duration==false, the early stopping
502    // decision is made according to the predicted objective values according to
503    // the target steps. If use_elapsed_duration==true, elapsed_secs is used
504    // instead of steps. Also, in this case, the parameters max_num_steps and
505    // min_num_steps are overloaded to contain max_elapsed_seconds and
506    // min_elapsed_seconds.
507    bool use_elapsed_duration = 5;
508
509    // ConvexAutomatedStoppingSpec by default only updates the trials that needs
510    // to be early stopped using a newly trained auto-regressive model. When
511    // this flag is set to True, all stopped trials from the beginning are
512    // potentially updated in terms of their `final_measurement`. Also, note
513    // that the training logic of autoregressive models is different in this
514    // case. Enabling this option has shown better results and this may be the
515    // default option in the future.
516    optional bool update_all_stopped_trials = 6;
517  }
518
519  // The configuration (stopping conditions) for automated stopping of a Study.
520  // Conditions include trial budgets, time budgets, and convergence detection.
521  message StudyStoppingConfig {
522    // If true, a Study enters STOPPING_ASAP whenever it would normally enters
523    // STOPPING state.
524    //
525    // The bottom line is: set to true if you want to interrupt on-going
526    // evaluations of Trials as soon as the study stopping condition is met.
527    // (Please see Study.State documentation for the source of truth).
528    google.protobuf.BoolValue should_stop_asap = 1;
529
530    // Each "stopping rule" in this proto specifies an "if" condition. Before
531    // Vizier would generate a new suggestion, it first checks each specified
532    // stopping rule, from top to bottom in this list.
533    // Note that the first few rules (e.g. minimum_runtime_constraint,
534    // min_num_trials) will prevent other stopping rules from being evaluated
535    // until they are met. For example, setting `min_num_trials=5` and
536    // `always_stop_after= 1 hour` means that the Study will ONLY stop after it
537    // has 5 COMPLETED trials, even if more than an hour has passed since its
538    // creation. It follows the first applicable rule (whose "if" condition is
539    // satisfied) to make a stopping decision. If none of the specified rules
540    // are applicable, then Vizier decides that the study should not stop.
541    // If Vizier decides that the study should stop, the study enters
542    // STOPPING state (or STOPPING_ASAP if should_stop_asap = true).
543    // IMPORTANT: The automatic study state transition happens precisely as
544    // described above; that is, deleting trials or updating StudyConfig NEVER
545    // automatically moves the study state back to ACTIVE. If you want to
546    // _resume_ a Study that was stopped, 1) change the stopping conditions if
547    // necessary, 2) activate the study, and then 3) ask for suggestions.
548    // If the specified time or duration has not passed, do not stop the
549    // study.
550    StudyTimeConstraint minimum_runtime_constraint = 2;
551
552    // If the specified time or duration has passed, stop the study.
553    StudyTimeConstraint maximum_runtime_constraint = 3;
554
555    // If there are fewer than this many COMPLETED trials, do not stop the
556    // study.
557    google.protobuf.Int32Value min_num_trials = 4;
558
559    // If there are more than this many trials, stop the study.
560    google.protobuf.Int32Value max_num_trials = 5;
561
562    // If the objective value has not improved for this many consecutive
563    // trials, stop the study.
564    //
565    // WARNING: Effective only for single-objective studies.
566    google.protobuf.Int32Value max_num_trials_no_progress = 6;
567
568    // If the objective value has not improved for this much time, stop the
569    // study.
570    //
571    // WARNING: Effective only for single-objective studies.
572    google.protobuf.Duration max_duration_no_progress = 7;
573  }
574
575  // The available search algorithms for the Study.
576  enum Algorithm {
577    // The default algorithm used by Vertex AI for [hyperparameter
578    // tuning](https://cloud.google.com/vertex-ai/docs/training/hyperparameter-tuning-overview)
579    // and [Vertex AI Vizier](https://cloud.google.com/vertex-ai/docs/vizier).
580    ALGORITHM_UNSPECIFIED = 0;
581
582    // Simple grid search within the feasible space. To use grid search,
583    // all parameters must be `INTEGER`, `CATEGORICAL`, or `DISCRETE`.
584    GRID_SEARCH = 2;
585
586    // Simple random search within the feasible space.
587    RANDOM_SEARCH = 3;
588  }
589
590  // Describes the noise level of the repeated observations.
591  //
592  // "Noisy" means that the repeated observations with the same Trial parameters
593  // may lead to different metric evaluations.
594  enum ObservationNoise {
595    // The default noise level chosen by Vertex AI.
596    OBSERVATION_NOISE_UNSPECIFIED = 0;
597
598    // Vertex AI assumes that the objective function is (nearly)
599    // perfectly reproducible, and will never repeat the same Trial
600    // parameters.
601    LOW = 1;
602
603    // Vertex AI will estimate the amount of noise in metric
604    // evaluations, it may repeat the same Trial parameters more than once.
605    HIGH = 2;
606  }
607
608  // This indicates which measurement to use if/when the service automatically
609  // selects the final measurement from previously reported intermediate
610  // measurements. Choose this based on two considerations:
611  //  A) Do you expect your measurements to monotonically improve?
612  //     If so, choose LAST_MEASUREMENT. On the other hand, if you're in a
613  //     situation where your system can "over-train" and you expect the
614  //     performance to get better for a while but then start declining,
615  //     choose BEST_MEASUREMENT.
616  //  B) Are your measurements significantly noisy and/or irreproducible?
617  //     If so, BEST_MEASUREMENT will tend to be over-optimistic, and it
618  //     may be better to choose LAST_MEASUREMENT.
619  //  If both or neither of (A) and (B) apply, it doesn't matter which
620  //  selection type is chosen.
621  enum MeasurementSelectionType {
622    // Will be treated as LAST_MEASUREMENT.
623    MEASUREMENT_SELECTION_TYPE_UNSPECIFIED = 0;
624
625    // Use the last measurement reported.
626    LAST_MEASUREMENT = 1;
627
628    // Use the best measurement reported.
629    BEST_MEASUREMENT = 2;
630  }
631
632  oneof automated_stopping_spec {
633    // The automated early stopping spec using decay curve rule.
634    DecayCurveAutomatedStoppingSpec decay_curve_stopping_spec = 4;
635
636    // The automated early stopping spec using median rule.
637    MedianAutomatedStoppingSpec median_automated_stopping_spec = 5;
638
639    // The automated early stopping spec using convex stopping rule.
640    ConvexAutomatedStoppingSpec convex_automated_stopping_spec = 9;
641  }
642
643  // Required. Metric specs for the Study.
644  repeated MetricSpec metrics = 1 [(google.api.field_behavior) = REQUIRED];
645
646  // Required. The set of parameters to tune.
647  repeated ParameterSpec parameters = 2
648      [(google.api.field_behavior) = REQUIRED];
649
650  // The search algorithm specified for the Study.
651  Algorithm algorithm = 3;
652
653  // The observation noise level of the study.
654  // Currently only supported by the Vertex AI Vizier service. Not supported by
655  // HyperparameterTuningJob or TrainingPipeline.
656  ObservationNoise observation_noise = 6;
657
658  // Describe which measurement selection type will be used
659  MeasurementSelectionType measurement_selection_type = 7;
660
661  // Conditions for automated stopping of a Study. Enable automated stopping by
662  // configuring at least one condition.
663  optional StudyStoppingConfig study_stopping_config = 11;
664}
665
666// A message representing a Measurement of a Trial. A Measurement contains
667// the Metrics got by executing a Trial using suggested hyperparameter
668// values.
669message Measurement {
670  // A message representing a metric in the measurement.
671  message Metric {
672    // Output only. The ID of the Metric. The Metric should be defined in
673    // [StudySpec's Metrics][google.cloud.aiplatform.v1.StudySpec.metrics].
674    string metric_id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
675
676    // Output only. The value for this metric.
677    double value = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
678  }
679
680  // Output only. Time that the Trial has been running at the point of this
681  // Measurement.
682  google.protobuf.Duration elapsed_duration = 1
683      [(google.api.field_behavior) = OUTPUT_ONLY];
684
685  // Output only. The number of steps the machine learning model has been
686  // trained for. Must be non-negative.
687  int64 step_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
688
689  // Output only. A list of metrics got by evaluating the objective functions
690  // using suggested Parameter values.
691  repeated Metric metrics = 3 [(google.api.field_behavior) = OUTPUT_ONLY];
692}
693