Trial

Struct Trial 

Source
#[non_exhaustive]
pub struct Trial { pub name: String, pub id: String, pub state: State, pub parameters: Vec<Parameter>, pub final_measurement: Option<Measurement>, pub measurements: Vec<Measurement>, pub start_time: Option<Timestamp>, pub end_time: Option<Timestamp>, pub client_id: String, pub infeasible_reason: String, pub custom_job: String, pub web_access_uris: HashMap<String, String>, /* private fields */ }
Available on crate features job-service or vizier-service only.
Expand description

A message representing a Trial. A Trial contains a unique set of Parameters that has been or will be evaluated, along with the objective metrics got by running the Trial.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output only. Resource name of the Trial assigned by the service.

§id: String

Output only. The identifier of the Trial assigned by the service.

§state: State

Output only. The detailed state of the Trial.

§parameters: Vec<Parameter>

Output only. The parameters of the Trial.

§final_measurement: Option<Measurement>

Output only. The final measurement containing the objective value.

§measurements: Vec<Measurement>

Output only. A list of measurements that are strictly lexicographically ordered by their induced tuples (steps, elapsed_duration). These are used for early stopping computations.

§start_time: Option<Timestamp>

Output only. Time when the Trial was started.

§end_time: Option<Timestamp>

Output only. Time when the Trial’s status changed to SUCCEEDED or INFEASIBLE.

§client_id: String

Output 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.

§infeasible_reason: String

Output only. A human readable string describing why the Trial is infeasible. This is set only if Trial state is INFEASIBLE.

§custom_job: String

Output only. The CustomJob name linked to the Trial. It’s set for a HyperparameterTuningJob’s Trial.

§web_access_uris: HashMap<String, String>

Output 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.

Implementations§

Source§

impl Trial

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Trial::new().set_name("example");
Source

pub fn set_id<T: Into<String>>(self, v: T) -> Self

Sets the value of id.

§Example
let x = Trial::new().set_id("example");
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_aiplatform_v1::model::trial::State;
let x0 = Trial::new().set_state(State::Requested);
let x1 = Trial::new().set_state(State::Active);
let x2 = Trial::new().set_state(State::Stopping);
Source

pub fn set_parameters<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Parameter>,

Sets the value of parameters.

§Example
use google_cloud_aiplatform_v1::model::trial::Parameter;
let x = Trial::new()
    .set_parameters([
        Parameter::default()/* use setters */,
        Parameter::default()/* use (different) setters */,
    ]);
Source

pub fn set_final_measurement<T>(self, v: T) -> Self
where T: Into<Measurement>,

Sets the value of final_measurement.

§Example
use google_cloud_aiplatform_v1::model::Measurement;
let x = Trial::new().set_final_measurement(Measurement::default()/* use setters */);
Source

pub fn set_or_clear_final_measurement<T>(self, v: Option<T>) -> Self
where T: Into<Measurement>,

Sets or clears the value of final_measurement.

§Example
use google_cloud_aiplatform_v1::model::Measurement;
let x = Trial::new().set_or_clear_final_measurement(Some(Measurement::default()/* use setters */));
let x = Trial::new().set_or_clear_final_measurement(None::<Measurement>);
Source

pub fn set_measurements<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Measurement>,

Sets the value of measurements.

§Example
use google_cloud_aiplatform_v1::model::Measurement;
let x = Trial::new()
    .set_measurements([
        Measurement::default()/* use setters */,
        Measurement::default()/* use (different) setters */,
    ]);
Source

pub fn set_start_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of start_time.

§Example
use wkt::Timestamp;
let x = Trial::new().set_start_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_start_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of start_time.

§Example
use wkt::Timestamp;
let x = Trial::new().set_or_clear_start_time(Some(Timestamp::default()/* use setters */));
let x = Trial::new().set_or_clear_start_time(None::<Timestamp>);
Source

pub fn set_end_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of end_time.

§Example
use wkt::Timestamp;
let x = Trial::new().set_end_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_end_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of end_time.

§Example
use wkt::Timestamp;
let x = Trial::new().set_or_clear_end_time(Some(Timestamp::default()/* use setters */));
let x = Trial::new().set_or_clear_end_time(None::<Timestamp>);
Source

pub fn set_client_id<T: Into<String>>(self, v: T) -> Self

Sets the value of client_id.

§Example
let x = Trial::new().set_client_id("example");
Source

pub fn set_infeasible_reason<T: Into<String>>(self, v: T) -> Self

Sets the value of infeasible_reason.

§Example
let x = Trial::new().set_infeasible_reason("example");
Source

pub fn set_custom_job<T: Into<String>>(self, v: T) -> Self

Sets the value of custom_job.

§Example
let x = Trial::new().set_custom_job("example");
Source

pub fn set_web_access_uris<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of web_access_uris.

§Example
let x = Trial::new().set_web_access_uris([
    ("key0", "abc"),
    ("key1", "xyz"),
]);

Trait Implementations§

Source§

impl Clone for Trial

Source§

fn clone(&self) -> Trial

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Trial

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Trial

Source§

fn default() -> Trial

Returns the “default value” for a type. Read more
Source§

impl Message for Trial

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Trial

Source§

fn eq(&self, other: &Trial) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Trial

Auto Trait Implementations§

§

impl Freeze for Trial

§

impl RefUnwindSafe for Trial

§

impl Send for Trial

§

impl Sync for Trial

§

impl Unpin for Trial

§

impl UnwindSafe for Trial

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,