#[non_exhaustive]pub struct DiscreteValueSpec {
pub values: Vec<f64>,
pub default_value: Option<f64>,
/* private fields */
}Available on crate features
job-service or vizier-service only.Expand description
Value specification for a parameter in DISCRETE type.
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.values: Vec<f64>Required. A list of possible values. The list should be in increasing order and at least 1e-10 apart. For instance, this parameter might have possible settings of 1.5, 2.5, and 4.0. This list should not contain more than 1,000 values.
default_value: Option<f64>A default value for a DISCRETE parameter that is assumed to be a
relatively good starting point. Unset value signals that there is no
offered starting point. It automatically rounds to the
nearest feasible discrete point.
Currently only supported by the Vertex AI Vizier service. Not supported by HyperparameterTuningJob or TrainingPipeline.
Implementations§
Source§impl DiscreteValueSpec
impl DiscreteValueSpec
pub fn new() -> Self
Sourcepub fn set_values<T, V>(self, v: T) -> Self
pub fn set_values<T, V>(self, v: T) -> Self
Sourcepub fn set_default_value<T>(self, v: T) -> Self
pub fn set_default_value<T>(self, v: T) -> Self
Sets the value of default_value.
§Example
ⓘ
let x = DiscreteValueSpec::new().set_default_value(42.0);Sourcepub fn set_or_clear_default_value<T>(self, v: Option<T>) -> Self
pub fn set_or_clear_default_value<T>(self, v: Option<T>) -> Self
Sets or clears the value of default_value.
§Example
ⓘ
let x = DiscreteValueSpec::new().set_or_clear_default_value(Some(42.0));
let x = DiscreteValueSpec::new().set_or_clear_default_value(None::<f32>);Trait Implementations§
Source§impl Clone for DiscreteValueSpec
impl Clone for DiscreteValueSpec
Source§fn clone(&self) -> DiscreteValueSpec
fn clone(&self) -> DiscreteValueSpec
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for DiscreteValueSpec
impl Debug for DiscreteValueSpec
Source§impl Default for DiscreteValueSpec
impl Default for DiscreteValueSpec
Source§fn default() -> DiscreteValueSpec
fn default() -> DiscreteValueSpec
Returns the “default value” for a type. Read more
Source§impl Message for DiscreteValueSpec
impl Message for DiscreteValueSpec
Source§impl PartialEq for DiscreteValueSpec
impl PartialEq for DiscreteValueSpec
impl StructuralPartialEq for DiscreteValueSpec
Auto Trait Implementations§
impl Freeze for DiscreteValueSpec
impl RefUnwindSafe for DiscreteValueSpec
impl Send for DiscreteValueSpec
impl Sync for DiscreteValueSpec
impl Unpin for DiscreteValueSpec
impl UnwindSafe for DiscreteValueSpec
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more